[Asterisk-code-review] asttest: Be explicit about the signedness of chars. (testsuite[16])

Sean Bright asteriskteam at digium.com
Fri May 13 14:11:00 CDT 2022


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/18539 )


Change subject: asttest: Be explicit about the signedness of chars.
......................................................................

asttest: Be explicit about the signedness of chars.

On arm64, chars are unsigned by default - as opposed to x86 where they are
signed by default. This causes problems when trying to compare chars with
negative numbers so be explicit where it matters.

Change-Id: I3f85d9252ae39227d82d5efaf6e6874cdfa71138
---
M asttest/asttest.c
M asttest/tools/mkstring.c
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/39/18539/1

diff --git a/asttest/asttest.c b/asttest/asttest.c
index 4375fa6..152d84a 100644
--- a/asttest/asttest.c
+++ b/asttest/asttest.c
@@ -73,7 +73,7 @@
  * @return 0 success
  */
 int parse_cmdline(int argc, char *argv[], struct asttest_opts *opts) {
-	char c;
+	signed char c;
 	memset(opts, 0, sizeof(struct asttest_opts));
 
 	/* set some default options */
diff --git a/asttest/tools/mkstring.c b/asttest/tools/mkstring.c
index 670477b..27774e0 100644
--- a/asttest/tools/mkstring.c
+++ b/asttest/tools/mkstring.c
@@ -66,7 +66,7 @@
 }
 
 int parse_cmdline(int argc, char *argv[], struct mkstring_options *opts) {
-	char c;
+	signed char c;
 	int i;
 	while ((c = getopt(argc, argv, "n:o:")) != -1) {
 		switch (c) {

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/18539
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-Change-Id: I3f85d9252ae39227d82d5efaf6e6874cdfa71138
Gerrit-Change-Number: 18539
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220513/e36bdf8b/attachment.html>


More information about the asterisk-code-review mailing list