Reads up to 4 little-endian bytes from fp and stores the result in the * uint32_t pointed to by dest in the host's byte order. Returns 0 on EOF or * nonzero on success. */
| 124 | * nonzero on success. |
| 125 | */ |
| 126 | static int ReadLittleBytes(uint32_t * dest, int bytes, FILE * fp) |
| 127 | { |
| 128 | uint32_t shift = 0; |
| 129 | |
| 130 | *dest = 0; |
| 131 | |
| 132 | while(bytes--) |
| 133 | { |
| 134 | int byte; |
| 135 | if((byte = fgetc(fp)) == EOF) return 0; |
| 136 | |
| 137 | *dest += (uint32_t)byte << shift; |
| 138 | shift += 8; |
| 139 | } |
| 140 | |
| 141 | return 1; |
| 142 | } |
| 143 | |
| 144 | /* Reads a little-endian uint32_t from fp and stores the result in *dest in the |
| 145 | * host's byte order. Returns 0 on EOF or nonzero on success. |
no outgoing calls
no test coverage detected