freemyipod r785 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r784‎ | r785 | r786 >
Date:14:49, 18 November 2011
Author:user890104
Status:new
Tags:
Comment:
emCOREFS: remove all those unneeded const qualifiers for arguments passed as values, also make the whole thing compile on both ubuntu (gcc 4.5.2) and osx (gcc 4.2.1).
Modified paths:
  • /emcore/trunk/tools/emcorefs/emcore.c (modified) (history)
  • /emcore/trunk/tools/emcorefs/emcore.h (modified) (history)
  • /emcore/trunk/tools/emcorefs/fuse.c (modified) (history)
  • /emcore/trunk/tools/emcorefs/fuse.h (modified) (history)
  • /emcore/trunk/tools/emcorefs/usb.c (modified) (history)
  • /emcore/trunk/tools/emcorefs/usb.h (modified) (history)
  • /emcore/trunk/tools/emcorefs/util.c (modified) (history)
  • /emcore/trunk/tools/emcorefs/util.h (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcorefs/usb.h
@@ -28,11 +28,11 @@
2929
3030
3131 int usb_init(void);
32 -int usb_find(const uint16_t vendor_id, const uint16_t product_id, uint8_t* reattach);
 32+int usb_find(uint16_t vendor_id, uint16_t product_id, uint8_t* reattach);
3333 int usb_open(libusb_device* dev, uint8_t* reattach);
34 -int usb_bulk_transfer(const unsigned char endpoint, void* data, const int length);
35 -int usb_close(const uint8_t reattach);
 34+int usb_bulk_transfer(unsigned char endpoint, void* data, int length);
 35+int usb_close(uint8_t reattach);
3636 void usb_exit(void);
37 -int usb_destroy(const uint8_t reattach);
 37+int usb_destroy(uint8_t reattach);
3838
3939 #endif /* __USB_H__ */
Index: emcore/trunk/tools/emcorefs/emcore.h
@@ -85,53 +85,53 @@
8686 EMCORE_ERROR_IO,
8787 };
8888
89 -int emcore_cout(const void* data, const uint32_t length);
90 -int emcore_cin(void* data, const uint32_t length);
91 -int emcore_dout(const void* data, const uint32_t length);
92 -int emcore_din(void* data, const uint32_t length);
 89+int emcore_cout(const void* data, uint32_t length);
 90+int emcore_cin(void* data, uint32_t length);
 91+int emcore_dout(const void* data, uint32_t length);
 92+int emcore_din(void* data, uint32_t length);
9393
94 -int emcore_monitor_command(const void* out, void* in, const uint32_t send_length, const uint32_t receive_length);
 94+int emcore_monitor_command(const void* out, void* in, uint32_t send_length, uint32_t receive_length);
9595
9696 int emcore_get_version(struct emcore_dev_info* dev_info);
9797 int emcore_get_packet_info(struct emcore_usb_endpoints_max_packet_size* max_packet_size);
9898 int emcore_get_user_mem_range(struct emcore_user_mem_range* mem_range);
99 -int emcore_reset(const uint8_t graceful);
100 -int emcore_poweroff(const uint8_t graceful);
101 -int emcore_readmem(void* data, const uint32_t addr, const uint32_t size);
102 -int emcore_writemem(const void* data, const uint32_t addr, const uint32_t size);
103 -int emcore_readdma(void* data, const uint32_t addr, const uint32_t size);
104 -int emcore_writedma(const void* data, const uint32_t addr, const uint32_t size);
105 -int emcore_readi2c(void* data, const uint8_t bus, const uint8_t slave, const uint8_t addr, const uint8_t size);
106 -int emcore_writei2c(const void* data, const uint8_t bus, const uint8_t slave, const uint8_t addr, const uint8_t size);
107 -int emcore_file_open(uint32_t* handle, const char* pathname, const int flags);
108 -int emcore_file_size(uint32_t* size, const uint32_t handle);
109 -int emcore_file_read(uint32_t* nread, const uint32_t handle, const uint32_t addr, const uint32_t size);
110 -int emcore_file_write(uint32_t* nwrite, const uint32_t handle, const uint32_t addr, const uint32_t size);
111 -int emcore_file_seek(const uint32_t handle, const uint32_t offset, const uint32_t whence);
112 -int emcore_file_truncate(const uint32_t handle, const uint32_t length);
113 -int emcore_file_sync(const uint32_t handle);
114 -int emcore_file_close(const uint32_t handle);
 99+int emcore_reset(uint8_t graceful);
 100+int emcore_poweroff(uint8_t graceful);
 101+int emcore_readmem(void* data, uint32_t addr, uint32_t size);
 102+int emcore_writemem(const void* data, uint32_t addr, uint32_t size);
 103+int emcore_readdma(void* data, uint32_t addr, uint32_t size);
 104+int emcore_writedma(const void* data, uint32_t addr, uint32_t size);
 105+int emcore_readi2c(void* data, uint8_t bus, uint8_t slave, uint8_t addr, uint8_t size);
 106+int emcore_writei2c(const void* data, uint8_t bus, uint8_t slave, uint8_t addr, uint8_t size);
 107+int emcore_file_open(uint32_t* handle, const char* pathname, int flags);
 108+int emcore_file_size(uint32_t* size, uint32_t handle);
 109+int emcore_file_read(uint32_t* nread, uint32_t handle, uint32_t addr, uint32_t size);
 110+int emcore_file_write(uint32_t* nwrite, uint32_t handle, uint32_t addr, uint32_t size);
 111+int emcore_file_seek(uint32_t handle, uint32_t offset, uint32_t whence);
 112+int emcore_file_truncate(uint32_t handle, uint32_t length);
 113+int emcore_file_sync(uint32_t handle);
 114+int emcore_file_close(uint32_t handle);
115115 int emcore_file_close_all(uint32_t* count);
116 -int emcore_file_kill_all(const uint32_t volume);
 116+int emcore_file_kill_all(uint32_t volume);
117117 int emcore_file_unlink(const char* name);
118118 int emcore_file_rename(const char* path, const char* newpath);
119119 int emcore_dir_open(uint32_t* handle, const char* name);
120 -int emcore_dir_read(struct emcore_dir_entry* entry, const uint32_t handle);
121 -int emcore_dir_close(const uint32_t handle);
 120+int emcore_dir_read(struct emcore_dir_entry* entry, uint32_t handle);
 121+int emcore_dir_close(uint32_t handle);
122122 int emcore_dir_close_all(uint32_t* count);
123123 int emcore_dir_create(const char* name);
124124 int emcore_dir_remove(const char* name);
125125 int emcore_errno(uint32_t* emcore_errno_value);
126 -int emcore_malloc(uint32_t* ptr, const uint32_t size);
127 -int emcore_memalign(uint32_t* ptr, const uint32_t align, const uint32_t size);
128 -int emcore_realloc(uint32_t* new_ptr, const uint32_t ptr, const uint32_t size);
129 -int emcore_reownalloc(const uint32_t ptr, const uint32_t owner);
130 -int emcore_free(const uint32_t ptr);
 126+int emcore_malloc(uint32_t* ptr, uint32_t size);
 127+int emcore_memalign(uint32_t* ptr, uint32_t align, uint32_t size);
 128+int emcore_realloc(uint32_t* new_ptr, uint32_t ptr, uint32_t size);
 129+int emcore_reownalloc(uint32_t ptr, uint32_t owner);
 130+int emcore_free(uint32_t ptr);
131131 int emcore_free_all(void);
132132
133 -int emcore_read(void* data, const uint32_t addr, const uint32_t size);
134 -int emcore_write(const void* data, const uint32_t addr, const uint32_t size);
135 -int emcore_ls(const uint32_t handle);
 133+int emcore_read(void* data, uint32_t addr, uint32_t size);
 134+int emcore_write(const void* data, uint32_t addr, uint32_t size);
 135+int emcore_ls(uint32_t handle);
136136 int emcore_test(void);
137137
138138 #endif /* __EMCORE_H__ */
Index: emcore/trunk/tools/emcorefs/fuse.c
@@ -255,9 +255,12 @@
256256 return 0;
257257 }
258258
259 -int emcorefs_read(const char* path, char* buf, uint32_t size, off_t offset, struct fuse_file_info* fi) {
 259+int emcorefs_read(const char* path, char* buf, size_t size, off_t offset, struct fuse_file_info* fi) {
 260+#ifdef DEBUG2
260261 fprintf(stderr, "FUSE_READ: path=[%s] size=[%d] offset=[%jd] fi->flags=[%d]\n", path, size, offset, fi->flags);
261 -
 262+#else
 263+ (void)path;
 264+#endif
262265 int res;
263266 uint32_t emcore_errno_value, addr, nread = size;
264267
@@ -346,9 +349,12 @@
347350 return nread;
348351 }
349352
350 -int emcorefs_write(const char* path, const char* buf, uint32_t size, off_t offset, struct fuse_file_info* fi) {
 353+int emcorefs_write(const char* path, const char* buf, size_t size, off_t offset, struct fuse_file_info* fi) {
 354+#ifdef DEBUG2
351355 fprintf(stderr, "FUSE_WRITE: path=[%s] size=[%d] offset=[%jd] fi->flags=[%d]\n", path, size, offset, fi->flags);
352 -
 356+#else
 357+ (void)path;
 358+#endif
353359 int res;
354360 uint32_t emcore_errno_value, addr, nwrite = size;
355361
Index: emcore/trunk/tools/emcorefs/util.h
@@ -36,10 +36,10 @@
3737 uint32_t tail;
3838 };
3939
40 -void dump_packet(const void* data, const uint32_t length);
41 -void alignsplit(struct alignsizes* sizeptr, const uint32_t addr, const uint32_t size, const uint32_t blksize, const uint32_t align);
42 -time_t fat_time_to_unix_ts(const short wrttime, const short wrtdate);
43 -int32_t unix_ts_to_fat_time(const time_t datetime);
44 -void print_error(const int code);
 40+void dump_packet(const void* data, size_t length);
 41+void alignsplit(struct alignsizes* sizeptr, uint32_t addr, uint32_t size, uint32_t blksize, uint32_t align);
 42+time_t fat_time_to_unix_ts(short wrttime, short wrtdate);
 43+int32_t unix_ts_to_fat_time(time_t datetime);
 44+void print_error(int code);
4545
4646 #endif /* __MISC_H__ */
Index: emcore/trunk/tools/emcorefs/fuse.h
@@ -32,8 +32,8 @@
3333 int emcorefs_readdir(const char* path, void* buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info* fi);
3434 int emcorefs_releasedir(const char* path, struct fuse_file_info* fi);
3535 int emcorefs_open(const char* path, struct fuse_file_info* fi);
36 -int emcorefs_read(const char* path, char* buf, uint32_t size, off_t offset, struct fuse_file_info* fi);
37 -int emcorefs_write(const char* path, const char* buf, uint32_t size, off_t offset, struct fuse_file_info* fi);
 36+int emcorefs_read(const char* path, char* buf, size_t size, off_t offset, struct fuse_file_info* fi);
 37+int emcorefs_write(const char* path, const char* buf, size_t size, off_t offset, struct fuse_file_info* fi);
3838 int emcorefs_release(const char* path, struct fuse_file_info* fi);
3939 int emcorefs_mkdir(const char* path, mode_t mode);
4040 int emcorefs_rmdir(const char* path);
Index: emcore/trunk/tools/emcorefs/usb.c
@@ -58,7 +58,7 @@
5959 return LIBUSB_SUCCESS;
6060 }
6161
62 -int usb_find(const uint16_t vendor_id, const uint16_t product_id, uint8_t* reattach)
 62+int usb_find(uint16_t vendor_id, uint16_t product_id, uint8_t* reattach)
6363 {
6464 libusb_device **devs, *dev;
6565 ssize_t devs_cnt;
@@ -289,7 +289,7 @@
290290 return LIBUSB_SUCCESS;
291291 }
292292
293 -int usb_bulk_transfer(const unsigned char endpoint, void* data, const int length)
 293+int usb_bulk_transfer(unsigned char endpoint, void* data, int length)
294294 {
295295 int transferred;
296296 int res;
@@ -309,7 +309,7 @@
310310 return LIBUSB_SUCCESS;
311311 }
312312
313 -int usb_close(const uint8_t reattach) {
 313+int usb_close(uint8_t reattach) {
314314 int res;
315315
316316 #ifdef DEBUG
@@ -364,7 +364,7 @@
365365 libusb_exit(usb_ctx);
366366 }
367367
368 -int usb_destroy(const uint8_t reattach)
 368+int usb_destroy(uint8_t reattach)
369369 {
370370 int res = LIBUSB_SUCCESS;
371371
Index: emcore/trunk/tools/emcorefs/emcore.c
@@ -31,28 +31,28 @@
3232 struct emcore_usb_endpoints_addr emcore_usb_eps_addr;
3333 struct emcore_usb_endpoints_max_packet_size emcore_usb_eps_mps;
3434
35 -int emcore_cout(const void* data, const uint32_t length)
 35+int emcore_cout(const void* data, uint32_t length)
3636 {
3737 return usb_bulk_transfer(emcore_usb_eps_addr.cout, (void*)data, length);
3838 }
3939
40 -int emcore_cin(void* data, const uint32_t length)
 40+int emcore_cin(void* data, uint32_t length)
4141 {
4242 return usb_bulk_transfer(emcore_usb_eps_addr.cin, data, length);
4343 }
4444
45 -int emcore_dout(const void* data, const uint32_t length)
 45+int emcore_dout(const void* data, uint32_t length)
4646 {
4747 return usb_bulk_transfer(emcore_usb_eps_addr.dout, (void*)data, length);
4848 }
4949
50 -int emcore_din(void* data, const uint32_t length)
 50+int emcore_din(void* data, uint32_t length)
5151 {
5252 return usb_bulk_transfer(emcore_usb_eps_addr.din, data, length);
5353 }
5454
5555 int emcore_monitor_command(const void* out, void* in,
56 - const uint32_t send_length, const uint32_t receive_length)
 56+ uint32_t send_length, uint32_t receive_length)
5757 {
5858 int res;
5959 uint32_t status;
@@ -170,7 +170,7 @@
171171 return EMCORE_SUCCESS;
172172 }
173173
174 -int emcore_reset(const uint8_t graceful)
 174+int emcore_reset(uint8_t graceful)
175175 {
176176 int res;
177177 uint32_t out[4] = { 2, 0xdeadbeef, 0, 0 }, in[4];
@@ -187,7 +187,7 @@
188188 return EMCORE_SUCCESS;
189189 }
190190
191 -int emcore_poweroff(const uint8_t graceful)
 191+int emcore_poweroff(uint8_t graceful)
192192 {
193193 int res;
194194 uint32_t out[4] = { 3, 0xdeadbeef, 0, 0 }, in[4];
@@ -204,7 +204,7 @@
205205 return EMCORE_SUCCESS;
206206 }
207207
208 -int emcore_readmem(void* data, const uint32_t addr, const uint32_t size)
 208+int emcore_readmem(void* data, uint32_t addr, uint32_t size)
209209 {
210210 int res;
211211 uint32_t data_length, out[4] = { 4, 0xdeadbeef, 0xdeadbeef, 0 };
@@ -233,7 +233,7 @@
234234 return EMCORE_SUCCESS;
235235 }
236236
237 -int emcore_writemem(const void* data, const uint32_t addr, const uint32_t size)
 237+int emcore_writemem(const void* data, uint32_t addr, uint32_t size)
238238 {
239239 int res;
240240 uint32_t data_length, in[4], *out;
@@ -262,7 +262,7 @@
263263 return EMCORE_SUCCESS;
264264 }
265265
266 -int emcore_readdma(void* data, const uint32_t addr, const uint32_t size)
 266+int emcore_readdma(void* data, uint32_t addr, uint32_t size)
267267 {
268268 int res;
269269 uint32_t out[4] = { 6, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
@@ -287,7 +287,7 @@
288288 return EMCORE_SUCCESS;
289289 }
290290
291 -int emcore_writedma(const void* data, const uint32_t addr, const uint32_t size)
 291+int emcore_writedma(const void* data, uint32_t addr, uint32_t size)
292292 {
293293 int res;
294294 uint32_t out[4] = { 7, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
@@ -312,7 +312,7 @@
313313 return EMCORE_SUCCESS;
314314 }
315315
316 -int emcore_readi2c(void* data, const uint8_t bus, const uint8_t slave, const uint8_t addr, const uint8_t size)
 316+int emcore_readi2c(void* data, uint8_t bus, uint8_t slave, uint8_t addr, uint8_t size)
317317 {
318318 int res;
319319 uint32_t data_length, out[4] = { 8, 0xdeadbeef, 0, 0 };
@@ -340,7 +340,7 @@
341341 return EMCORE_SUCCESS;
342342 }
343343
344 -int emcore_writei2c(const void* data, const uint8_t bus, const uint8_t slave, const uint8_t addr, const uint8_t size)
 344+int emcore_writei2c(const void* data, uint8_t bus, uint8_t slave, uint8_t addr, uint8_t size)
345345 {
346346 int res;
347347 uint32_t data_length, in[4], *out;
@@ -371,7 +371,7 @@
372372 return EMCORE_SUCCESS;
373373 }
374374
375 -int emcore_file_open(uint32_t* handle, const char* path, const int flags)
 375+int emcore_file_open(uint32_t* handle, const char* path, int flags)
376376 {
377377 int res;
378378 uint32_t str_length, data_length, in[4], *out;
@@ -441,7 +441,7 @@
442442 return EMCORE_SUCCESS;
443443 }
444444
445 -int emcore_file_size(uint32_t* size, const uint32_t handle)
 445+int emcore_file_size(uint32_t* size, uint32_t handle)
446446 {
447447 int res;
448448 uint32_t out[4] = { 31, 0xdeadbeef, 0, 0 }, in[4];
@@ -465,7 +465,7 @@
466466 return EMCORE_SUCCESS;
467467 }
468468
469 -int emcore_file_read(uint32_t* nread, const uint32_t handle, const uint32_t addr, const uint32_t size)
 469+int emcore_file_read(uint32_t* nread, uint32_t handle, uint32_t addr, uint32_t size)
470470 {
471471 int res;
472472 uint32_t out[4] = { 32, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef }, in[4];
@@ -491,7 +491,7 @@
492492 return EMCORE_SUCCESS;
493493 }
494494
495 -int emcore_file_write(uint32_t* nwrite, const uint32_t handle, const uint32_t addr, const uint32_t size)
 495+int emcore_file_write(uint32_t* nwrite, uint32_t handle, uint32_t addr, uint32_t size)
496496 {
497497 int res;
498498 uint32_t out[4] = { 33, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef }, in[4];
@@ -517,7 +517,7 @@
518518 return EMCORE_SUCCESS;
519519 }
520520
521 -int emcore_file_seek(const uint32_t handle, const uint32_t offset, const uint32_t whence)
 521+int emcore_file_seek(uint32_t handle, uint32_t offset, uint32_t whence)
522522 {
523523 int res;
524524 uint32_t out[4] = { 34, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef }, in[4];
@@ -541,7 +541,7 @@
542542 return EMCORE_SUCCESS;
543543 }
544544
545 -int emcore_file_truncate(const uint32_t handle, const uint32_t length)
 545+int emcore_file_truncate(uint32_t handle, uint32_t length)
546546 {
547547 int res;
548548 uint32_t out[4] = { 35, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
@@ -564,7 +564,7 @@
565565 return EMCORE_SUCCESS;
566566 }
567567
568 -int emcore_file_sync(const uint32_t handle)
 568+int emcore_file_sync(uint32_t handle)
569569 {
570570 int res;
571571 uint32_t out[4] = { 36, 0xdeadbeef, 0, 0 }, in[4];
@@ -586,7 +586,7 @@
587587 return EMCORE_SUCCESS;
588588 }
589589
590 -int emcore_file_close(const uint32_t handle)
 590+int emcore_file_close(uint32_t handle)
591591 {
592592 int res;
593593 uint32_t out[4] = { 37, 0xdeadbeef, 0, 0 }, in[4];
@@ -630,7 +630,7 @@
631631 return EMCORE_SUCCESS;
632632 }
633633
634 -int emcore_file_kill_all(const uint32_t volume)
 634+int emcore_file_kill_all(uint32_t volume)
635635 {
636636 int res;
637637 uint32_t out[4] = { 39, 0xdeadbeef, 0, 0 }, in[4];
@@ -751,7 +751,7 @@
752752 return EMCORE_SUCCESS;
753753 }
754754
755 -int emcore_dir_read(struct emcore_dir_entry* entry, const uint32_t handle)
 755+int emcore_dir_read(struct emcore_dir_entry* entry, uint32_t handle)
756756 {
757757 int res;
758758 uint32_t maxpath, ptr, dirent_size, emcore_errno_value, filename_buf_len,
@@ -825,7 +825,7 @@
826826 return EMCORE_SUCCESS;
827827 }
828828
829 -int emcore_dir_close(const uint32_t handle)
 829+int emcore_dir_close(uint32_t handle)
830830 {
831831 int res;
832832 uint32_t out[4] = { 44, 0xdeadbeef, 0, 0 }, in[4];
@@ -954,7 +954,7 @@
955955 return EMCORE_SUCCESS;
956956 }
957957
958 -int emcore_malloc(uint32_t* ptr, const uint32_t size)
 958+int emcore_malloc(uint32_t* ptr, uint32_t size)
959959 {
960960 int res;
961961 uint32_t out[4] = { 52, 0xdeadbeef, 0, 0 }, in[4];
@@ -973,7 +973,7 @@
974974 return EMCORE_SUCCESS;
975975 }
976976
977 -int emcore_memalign(uint32_t* ptr, const uint32_t align, const uint32_t size)
 977+int emcore_memalign(uint32_t* ptr, uint32_t align, uint32_t size)
978978 {
979979 int res;
980980 uint32_t out[4] = { 53, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
@@ -993,7 +993,7 @@
994994 return EMCORE_SUCCESS;
995995 }
996996
997 -int emcore_realloc(uint32_t* new_ptr, const uint32_t ptr, const uint32_t size)
 997+int emcore_realloc(uint32_t* new_ptr, uint32_t ptr, uint32_t size)
998998 {
999999 int res;
10001000 uint32_t out[4] = { 54, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
@@ -1013,7 +1013,7 @@
10141014 return EMCORE_SUCCESS;
10151015 }
10161016
1017 -int emcore_reownalloc(const uint32_t ptr, const uint32_t owner)
 1017+int emcore_reownalloc(uint32_t ptr, uint32_t owner)
10181018 {
10191019 uint32_t out[4] = { 55, 0xdeadbeef, 0xdeadbeef, 0 }, in[4];
10201020
@@ -1023,7 +1023,7 @@
10241024 return emcore_monitor_command(out, in, 16, 16);
10251025 }
10261026
1027 -int emcore_free(const uint32_t ptr)
 1027+int emcore_free(uint32_t ptr)
10281028 {
10291029 uint32_t out[4] = { 56, 0xdeadbeef, 0, 0 }, in[4];
10301030
@@ -1039,7 +1039,7 @@
10401040 return emcore_monitor_command(out, in, 16, 16);
10411041 }
10421042
1043 -int emcore_read(void* data, const uint32_t addr, const uint32_t size)
 1043+int emcore_read(void* data, uint32_t addr, uint32_t size)
10441044 {
10451045 int res;
10461046 struct alignsizes* sizes;
@@ -1107,7 +1107,7 @@
11081108 return EMCORE_SUCCESS;
11091109 }
11101110
1111 -int emcore_write(const void* data, const uint32_t addr, const uint32_t size)
 1111+int emcore_write(const void* data, uint32_t addr, uint32_t size)
11121112 {
11131113 int res;
11141114 struct alignsizes* sizes;
@@ -1175,7 +1175,7 @@
11761176 return EMCORE_SUCCESS;
11771177 }
11781178
1179 -int emcore_ls(const uint32_t handle)
 1179+int emcore_ls(uint32_t handle)
11801180 {
11811181 int res = 0;
11821182 struct emcore_dir_entry entry;
Index: emcore/trunk/tools/emcorefs/util.c
@@ -57,7 +57,7 @@
5858 "I/O error", /* EMCORE_ERROR_IO = 9 */
5959 };
6060
61 -void dump_packet(const void* data, const size_t length)
 61+void dump_packet(const void* data, size_t length)
6262 {
6363 static size_t i;
6464
@@ -79,8 +79,8 @@
8080 fprintf(stderr, "\n");
8181 }
8282
83 -void alignsplit(struct alignsizes* sizeptr, const uint32_t addr,
84 - const uint32_t size, const uint32_t blksize, const uint32_t align)
 83+void alignsplit(struct alignsizes* sizeptr, uint32_t addr,
 84+ uint32_t size, uint32_t blksize, uint32_t align)
8585 {
8686 uint32_t end, bodyaddr, tailaddr;
8787
@@ -121,7 +121,7 @@
122122 return;
123123 }
124124
125 -time_t fat_time_to_unix_ts(const short wrttime, const short wrtdate)
 125+time_t fat_time_to_unix_ts(short wrttime, short wrtdate)
126126 {
127127 struct tm result;
128128 /*
@@ -148,7 +148,7 @@
149149 return mktime(&result);
150150 }
151151
152 -int32_t unix_ts_to_fat_time(const time_t datetime)
 152+int32_t unix_ts_to_fat_time(time_t datetime)
153153 {
154154 struct tm* tm_ptr;
155155
@@ -162,7 +162,7 @@
163163 ((tm_ptr->tm_year - 80) << 0x19);
164164 }
165165
166 -void print_error(const int code)
 166+void print_error(int code)
167167 {
168168 if (code > 0)
169169 {