Merge pull request #2 from ksherlock/modern_c_warnings

Modern c warnings
This commit is contained in:
MikeW50 2018-03-25 15:31:15 -06:00 committed by GitHub
commit 1096519934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 11 deletions

View File

@ -489,10 +489,14 @@ int Read2 (void)
int num; int num;
num = 0; num = 0;
if (s[32]) if (s[32]) {
num = (s[ds++]<<8)+s[ds++]; num = s[ds++]<<8;
else num |= s[ds++];
num = s[ds++]+(s[ds++]<<8); }
else {
num = s[ds++];
num |= s[ds++]<<8;
}
return num; return num;
} }
@ -518,12 +522,18 @@ long Read4 (void)
long num; long num;
num = 0; num = 0;
if (s[32]) if (s[32]) {
num = (((unsigned long) s[ds++])<<24) | (((unsigned long) s[ds++])<<16) num = ((unsigned long) s[ds++])<<24;
| (s[ds++]<<8) | s[ds++]; num |= ((unsigned long) s[ds++])<<16;
else num |= (s[ds++]<<8);
num = s[ds++] | (s[ds++]<<8) | (((unsigned long) s[ds++])<<16) num |= s[ds++];
| (((unsigned long) s[ds++])<<24); }
else {
num = s[ds++];
num |= (s[ds++]<<8);
num |= ((unsigned long) s[ds++])<<16;
num |= ((unsigned long) s[ds++])<<24;
}
return num; return num;
} }
@ -1032,7 +1042,7 @@ if (argcnt < largc)
else { else {
while (isspace(line[0])) NextCh(); while (isspace(line[0])) NextCh();
if (!line[0]) { if (!line[0]) {
printf(prompt); fputs(prompt, stdout);
fgets(line, MAXLINE, stdin); fgets(line, MAXLINE, stdin);
} }
while (isspace(line[0])) NextCh(); while (isspace(line[0])) NextCh();