Formats the source and updates the gcc warning pragmas
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user