Fixed stupid typo.
authorManuel Mohr <manuel.mohr@kit.edu>
Wed, 7 Dec 2011 16:45:34 +0000 (17:45 +0100)
committerManuel Mohr <manuel.mohr@kit.edu>
Wed, 7 Dec 2011 16:48:45 +0000 (17:48 +0100)
ir/ir/irprofile.c
support/libfirmprof/instrument.c

index 352455c..70e2340 100644 (file)
@@ -532,9 +532,9 @@ parse_profile(const char *filename, unsigned int num_blocks)
        /* The profiling output format is defined to be a sequence of integer
         * values stored little endian format. */
        for (i = 0; i < num_blocks; ++i) {
-               char bytes[4];
+               unsigned char bytes[4];
 
-               if ((ret = fread(bytes, 4, 1, f)) < 1)
+               if ((ret = fread(bytes, 1, 4, f)) < 1)
                        break;
 
                result[i] = (bytes[0] <<  0) | (bytes[1] <<  8)
index b3e9fe6..18db0b5 100644 (file)
@@ -29,15 +29,15 @@ void write_little_endian(unsigned *counter, unsigned len, FILE *f)
        unsigned i;
 
        for (i = 0; i < len; ++i) {
-               unsigned v = counter[i];
-               char     bytes[4];
+               unsigned      v = counter[i];
+               unsigned char bytes[4];
 
                bytes[0] = ((v >>  0) & 0xff);
                bytes[1] = ((v >>  8) & 0xff);
                bytes[2] = ((v >> 16) & 0xff);
                bytes[3] = ((v >> 24) & 0xff);
 
-               fwrite(bytes, 4, 1, f);
+               fwrite(bytes, 1, 4, f);
        }
 }