Formats the source and updates the gcc warning pragmas

This commit is contained in:
Dana Robinson
2021-03-24 17:39:37 -07:00
parent bdac2ecdbf
commit feb20aac30
1148 changed files with 333582 additions and 325132 deletions

View File

@@ -27,9 +27,9 @@
*/
#define NELMTS 6
#define TYPE int
#define FORMAT "%d "
#define NELMTS 6
#define TYPE int
#define FORMAT "%d "
/*-------------------------------------------------------------------------
* Function: usage
@@ -45,7 +45,7 @@
*-------------------------------------------------------------------------
*/
static void
usage (void)
usage(void)
{
fprintf(stderr, "usage: binread FILE_NAME\n");
}
@@ -59,13 +59,13 @@ usage (void)
*/
int
main (int argc, const char *argv[])
main(int argc, const char *argv[])
{
FILE *stream;
FILE * stream;
size_t numread;
TYPE buf[NELMTS];
size_t i, nelmts = NELMTS;
char *fname=NULL;
char * fname = NULL;
if (argc != 2) {
usage();
@@ -74,12 +74,12 @@ main (int argc, const char *argv[])
fname = strdup(argv[1]);
if((stream = fopen(fname, "rb")) != NULL) {
numread = fread(buf, sizeof( TYPE ), nelmts, stream);
if ((stream = fopen(fname, "rb")) != NULL) {
numread = fread(buf, sizeof(TYPE), nelmts, stream);
printf("Number of items read = %llu\n", (unsigned long long)numread);
for (i = 0; i < nelmts; i++) {
printf(FORMAT,buf[i]);
printf(FORMAT, buf[i]);
}
printf("\n");
@@ -92,4 +92,3 @@ main (int argc, const char *argv[])
return 0;
}