diff options
-rw-r--r-- | rbutil/sansapatcher/sansaio-posix.c | 2 | ||||
-rw-r--r-- | rbutil/sansapatcher/sansaio-win32.c | 4 | ||||
-rw-r--r-- | rbutil/sansapatcher/sansapatcher.c | 60 |
3 files changed, 33 insertions, 33 deletions
diff --git a/rbutil/sansapatcher/sansaio-posix.c b/rbutil/sansapatcher/sansaio-posix.c index 9c3ec0403e..4c28afa1c2 100644 --- a/rbutil/sansapatcher/sansaio-posix.c +++ b/rbutil/sansapatcher/sansaio-posix.c | |||
@@ -86,7 +86,7 @@ int sansa_open(struct sansa_t* sansa, int silent) | |||
86 | if (!silent) { | 86 | if (!silent) { |
87 | fprintf(stderr,"[ERR] ioctl() call to get sector size failed, defaulting to %d\n" | 87 | fprintf(stderr,"[ERR] ioctl() call to get sector size failed, defaulting to %d\n" |
88 | ,sansa->sector_size); | 88 | ,sansa->sector_size); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
diff --git a/rbutil/sansapatcher/sansaio-win32.c b/rbutil/sansapatcher/sansaio-win32.c index 30c378b0fc..2b93d2807d 100644 --- a/rbutil/sansapatcher/sansaio-win32.c +++ b/rbutil/sansapatcher/sansaio-win32.c | |||
@@ -44,7 +44,7 @@ static int lock_volume(HANDLE hDisk) | |||
44 | DWORD dummy; | 44 | DWORD dummy; |
45 | 45 | ||
46 | return DeviceIoControl(hDisk, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, | 46 | return DeviceIoControl(hDisk, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, |
47 | &dummy, NULL); | 47 | &dummy, NULL); |
48 | } | 48 | } |
49 | 49 | ||
50 | static int unlock_volume(HANDLE hDisk) | 50 | static int unlock_volume(HANDLE hDisk) |
@@ -52,7 +52,7 @@ static int unlock_volume(HANDLE hDisk) | |||
52 | DWORD dummy; | 52 | DWORD dummy; |
53 | 53 | ||
54 | return DeviceIoControl(hDisk, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, | 54 | return DeviceIoControl(hDisk, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, |
55 | &dummy, NULL); | 55 | &dummy, NULL); |
56 | } | 56 | } |
57 | 57 | ||
58 | #ifndef RBUTIL | 58 | #ifndef RBUTIL |
diff --git a/rbutil/sansapatcher/sansapatcher.c b/rbutil/sansapatcher/sansapatcher.c index e2e9c88936..8d3191901a 100644 --- a/rbutil/sansapatcher/sansapatcher.c +++ b/rbutil/sansapatcher/sansapatcher.c | |||
@@ -173,10 +173,10 @@ sansa_memmem (haystack, haystack_len, needle, needle_len) | |||
173 | 173 | ||
174 | for (begin = (const char *) haystack; begin <= last_possible; ++begin) | 174 | for (begin = (const char *) haystack; begin <= last_possible; ++begin) |
175 | if (begin[0] == ((const char *) needle)[0] && | 175 | if (begin[0] == ((const char *) needle)[0] && |
176 | !memcmp ((const void *) &begin[1], | 176 | !memcmp ((const void *) &begin[1], |
177 | (const void *) ((const char *) needle + 1), | 177 | (const void *) ((const char *) needle + 1), |
178 | needle_len - 1)) | 178 | needle_len - 1)) |
179 | return (void *) begin; | 179 | return (void *) begin; |
180 | 180 | ||
181 | return NULL; | 181 | return NULL; |
182 | } | 182 | } |
@@ -197,15 +197,15 @@ sansa_memmem (haystack, haystack_len, needle, needle_len) | |||
197 | */ | 197 | */ |
198 | 198 | ||
199 | /* crc_tab[] -- this crcTable is being build by chksum_crc32GenTab(). | 199 | /* crc_tab[] -- this crcTable is being build by chksum_crc32GenTab(). |
200 | * so make sure, you call it before using the other | 200 | * so make sure, you call it before using the other |
201 | * functions! | 201 | * functions! |
202 | */ | 202 | */ |
203 | static unsigned int crc_tab[256]; | 203 | static unsigned int crc_tab[256]; |
204 | 204 | ||
205 | /* chksum_crc() -- to a given block, this one calculates the | 205 | /* chksum_crc() -- to a given block, this one calculates the |
206 | * crc32-checksum until the length is | 206 | * crc32-checksum until the length is |
207 | * reached. the crc32-checksum will be | 207 | * reached. the crc32-checksum will be |
208 | * the result. | 208 | * the result. |
209 | */ | 209 | */ |
210 | static unsigned int chksum_crc32 (const unsigned char *block, unsigned int length) | 210 | static unsigned int chksum_crc32 (const unsigned char *block, unsigned int length) |
211 | { | 211 | { |
@@ -221,32 +221,32 @@ static unsigned int chksum_crc32 (const unsigned char *block, unsigned int lengt | |||
221 | } | 221 | } |
222 | 222 | ||
223 | /* chksum_crc32gentab() -- to a global crc_tab[256], this one will | 223 | /* chksum_crc32gentab() -- to a global crc_tab[256], this one will |
224 | * calculate the crcTable for crc32-checksums. | 224 | * calculate the crcTable for crc32-checksums. |
225 | * it is generated to the polynom [..] | 225 | * it is generated to the polynom [..] |
226 | */ | 226 | */ |
227 | 227 | ||
228 | static void chksum_crc32gentab (void) | 228 | static void chksum_crc32gentab (void) |
229 | { | 229 | { |
230 | unsigned long crc, poly; | 230 | unsigned long crc, poly; |
231 | int i, j; | 231 | int i, j; |
232 | 232 | ||
233 | poly = 0xEDB88320L; | 233 | poly = 0xEDB88320L; |
234 | for (i = 0; i < 256; i++) | 234 | for (i = 0; i < 256; i++) |
235 | { | 235 | { |
236 | crc = i; | 236 | crc = i; |
237 | for (j = 8; j > 0; j--) | 237 | for (j = 8; j > 0; j--) |
238 | { | 238 | { |
239 | if (crc & 1) | 239 | if (crc & 1) |
240 | { | 240 | { |
241 | crc = (crc >> 1) ^ poly; | 241 | crc = (crc >> 1) ^ poly; |
242 | } | 242 | } |
243 | else | 243 | else |
244 | { | 244 | { |
245 | crc >>= 1; | 245 | crc >>= 1; |
246 | } | 246 | } |
247 | } | 247 | } |
248 | crc_tab[i] = crc; | 248 | crc_tab[i] = crc; |
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | /* Known keys for Sansa E200 and C200 firmwares: */ | 252 | /* Known keys for Sansa E200 and C200 firmwares: */ |