From c847bd14e232c17d6c4ab54e200a17a9a5413adc Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 5 Feb 2019 23:44:18 -0800 Subject: [PATCH 1/2] Document C-like type casting syntax In addition to the existing documentation of functional notation, add documentation of the C-like notation as well. This will bring some consistency with the the documentation for the casts to multi-word types (e.g., unsigned int). --- Language/Variables/Conversion/byteCast.adoc | 3 ++- Language/Variables/Conversion/charCast.adoc | 3 ++- Language/Variables/Conversion/floatCast.adoc | 3 ++- Language/Variables/Conversion/intCast.adoc | 3 ++- Language/Variables/Conversion/longCast.adoc | 3 ++- Language/Variables/Conversion/wordcast.adoc | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Language/Variables/Conversion/byteCast.adoc b/Language/Variables/Conversion/byteCast.adoc index 1b6eb6e9d..2aef0f0e1 100644 --- a/Language/Variables/Conversion/byteCast.adoc +++ b/Language/Variables/Conversion/byteCast.adoc @@ -23,7 +23,8 @@ Converts a value to the link:../../data-types/byte[byte] data type. [float] === Syntax -`byte(x)` +`byte(x)` + +`(byte)x` (C-style type conversion) [float] diff --git a/Language/Variables/Conversion/charCast.adoc b/Language/Variables/Conversion/charCast.adoc index 6c2d8e791..9c39619ca 100644 --- a/Language/Variables/Conversion/charCast.adoc +++ b/Language/Variables/Conversion/charCast.adoc @@ -23,7 +23,8 @@ Converts a value to the link:../../data-types/char[char] data type. [float] === Syntax -`char(x)` +`char(x)` + +`(char)x` (C-style type conversion) [float] diff --git a/Language/Variables/Conversion/floatCast.adoc b/Language/Variables/Conversion/floatCast.adoc index 9b0da90cb..d813d2f43 100644 --- a/Language/Variables/Conversion/floatCast.adoc +++ b/Language/Variables/Conversion/floatCast.adoc @@ -23,7 +23,8 @@ Converts a value to the link:../../data-types/float[float] data type. [float] === Syntax -`float(x)` +`float(x)` + +`(float)x` (C-style type conversion) [float] diff --git a/Language/Variables/Conversion/intCast.adoc b/Language/Variables/Conversion/intCast.adoc index a087cb6a2..c9d5d29d4 100644 --- a/Language/Variables/Conversion/intCast.adoc +++ b/Language/Variables/Conversion/intCast.adoc @@ -23,7 +23,8 @@ Converts a value to the link:../../data-types/int[int] data type. [float] === Syntax -`int(x)` +`int(x)` + +`(int)x` (C-style type conversion) [float] diff --git a/Language/Variables/Conversion/longCast.adoc b/Language/Variables/Conversion/longCast.adoc index 05749fd89..3751aaef9 100644 --- a/Language/Variables/Conversion/longCast.adoc +++ b/Language/Variables/Conversion/longCast.adoc @@ -23,7 +23,8 @@ Converts a value to the link:../../data-types/long[long] data type. [float] === Syntax -`long(x)` +`long(x)` + +`(long)x` (C-style type conversion) [float] diff --git a/Language/Variables/Conversion/wordcast.adoc b/Language/Variables/Conversion/wordcast.adoc index 19cff9667..14ab38f94 100644 --- a/Language/Variables/Conversion/wordcast.adoc +++ b/Language/Variables/Conversion/wordcast.adoc @@ -24,7 +24,8 @@ Converts a value to the link:../../data-types/word[word] data type. [float] === Syntax `word(x)` + -`word(h, l)` +`word(h, l)` + +`(word)x` (C-style type conversion) [float] === Parameters From 584ff5eb24056c55e41328ee4f5eff3358f8f7b1 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 5 Feb 2019 23:54:27 -0800 Subject: [PATCH 2/2] Add unsigned int/long type casting pages I'm not certain whether casting pages for all the types in the reference should be added, but certainly it must be demonstrated that casting can be done to the multi-word types as well. unsigned int/unsigned long are important types, so at a minimum these must be added. Likely it would have been best to write a single generic page on type casting but we took the other fork in the road too long ago to turn back now. --- .../Variables/Conversion/unsignedIntCast.adoc | 55 +++++++++++++++++++ .../Conversion/unsignedLongCast.adoc | 55 +++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 Language/Variables/Conversion/unsignedIntCast.adoc create mode 100644 Language/Variables/Conversion/unsignedLongCast.adoc diff --git a/Language/Variables/Conversion/unsignedIntCast.adoc b/Language/Variables/Conversion/unsignedIntCast.adoc new file mode 100644 index 000000000..863d2724e --- /dev/null +++ b/Language/Variables/Conversion/unsignedIntCast.adoc @@ -0,0 +1,55 @@ +--- +title: (unsigned int) +categories: [ "Variables" ] +subCategories: [ "Conversion" ] +--- + + + + + += (unsigned int) + + +// OVERVIEW SECTION STARTS +[#overview] +-- + +[float] +=== Description +Converts a value to the link:../../data-types/unsignedint[unsigned int] data type. +[%hardbreaks] + + +[float] +=== Syntax +`(unsigned int)x` + + +[float] +=== Parameters +`x`: a value of any type + +[float] +=== Returns +`unsigned int` + +-- +// OVERVIEW SECTION ENDS + + + + +// SEE ALSO SECTION +[#see_also] +-- + +[float] +=== See also + +[role="language"] +* #LANGUAGE# link:../../data-types/unsignedint[unsigned int] + + +-- +// SEE ALSO SECTION ENDS \ No newline at end of file diff --git a/Language/Variables/Conversion/unsignedLongCast.adoc b/Language/Variables/Conversion/unsignedLongCast.adoc new file mode 100644 index 000000000..c950d2b7c --- /dev/null +++ b/Language/Variables/Conversion/unsignedLongCast.adoc @@ -0,0 +1,55 @@ +--- +title: (unsigned long) +categories: [ "Variables" ] +subCategories: [ "Conversion" ] +--- + + + + + += (unsigned long) + + +// OVERVIEW SECTION STARTS +[#overview] +-- + +[float] +=== Description +Converts a value to the link:../../data-types/unsignedlong[unsigned long] data type. +[%hardbreaks] + + +[float] +=== Syntax +`(unsigned long)x` + + +[float] +=== Parameters +`x`: a value of any type + +[float] +=== Returns +`unsigned long` + +-- +// OVERVIEW SECTION ENDS + + + + +// SEE ALSO SECTION STARTS +[#see_also] +-- + +[float] +=== See also + +[role="language"] +* #LANGUAGE# link:../../data-types/unsignedlong[unsigned long] + + +-- +// SEE ALSO SECTION ENDS \ No newline at end of file