git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@380 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/03/08 09:27:15... | ... |
@@ -72,6 +72,7 @@ Hrvoje Habjanic <hrvoje.habjanic*zg.hinet.hr> |
72 | 72 |
Robert Hogan <robert*roberthogan.net> |
73 | 73 |
James F. Hranicky <jfh*cise.ufl.edu> |
74 | 74 |
Andy Igoshin <ai*vsu.ru> |
75 |
+Jesper Juhl <juhl*dif.dk> |
|
75 | 76 |
Nicholas M. Kirsch <nick*kirsch.org> |
76 | 77 |
Robbert Kouprie <robbert*exx.nl> |
77 | 78 |
Martin Kraft <martin.kraft*fal.de> |
... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Mon Mar 8 01:24:37 CET 2004 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * applied comments cleanup (C89) patch (global) from Jesper Juhl |
|
4 |
+ <juhl*dif.dk> |
|
5 |
+ |
|
1 | 6 |
Mon Mar 8 00:33:17 CET 2004 (tk) |
2 | 7 |
--------------------------------- |
3 | 8 |
* clamd: fixed QUIT/SHUTDOWN command - break blocking accept() to allow |
... | ... |
@@ -143,8 +143,7 @@ struct cfgstruct *parsecfg(const char *cfgfile) |
143 | 143 |
fprintf(stderr, "ERROR: Parse error at line %d: Option %s requires string as argument.\n", line, name); |
144 | 144 |
return NULL; |
145 | 145 |
} |
146 |
- // FIXME: this one is an ugly hack of the above |
|
147 |
- // case |
|
146 |
+ /* FIXME: this one is an ugly hack of the above case */ |
|
148 | 147 |
free(arg); |
149 | 148 |
arg = strstr(buff, " "); |
150 | 149 |
arg = strdup(++arg); |
... | ... |
@@ -49,7 +49,9 @@ int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struc |
49 | 49 |
|
50 | 50 |
if((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { |
51 | 51 |
estr = strerror(errno); |
52 |
- //fprintf(stderr, "ERROR: socket() error: %s\n", estr); |
|
52 |
+ /* |
|
53 |
+ fprintf(stderr, "ERROR: socket() error: %s\n", estr); |
|
54 |
+ */ |
|
53 | 55 |
logg("!Socket allocation error: %s\n", estr); |
54 | 56 |
exit(1); |
55 | 57 |
} |
... | ... |
@@ -95,7 +97,9 @@ int localserver(const struct optstruct *opt, const struct cfgstruct *copt, struc |
95 | 95 |
|
96 | 96 |
if(listen(sockfd, backlog) == -1) { |
97 | 97 |
estr = strerror(errno); |
98 |
- //fprintf(stderr, "ERROR: listen() error: %s\n", estr); |
|
98 |
+ /* |
|
99 |
+ fprintf(stderr, "ERROR: listen() error: %s\n", estr); |
|
100 |
+ */ |
|
99 | 101 |
logg("!listen() error: %s\n", estr); |
100 | 102 |
exit(1); |
101 | 103 |
} |
... | ... |
@@ -64,7 +64,9 @@ int tcpserver(const struct optstruct *opt, const struct cfgstruct *copt, struct |
64 | 64 |
|
65 | 65 |
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { |
66 | 66 |
estr = strerror(errno); |
67 |
- //fprintf(stderr, "ERROR: socket() error: %s\n", estr); |
|
67 |
+ /* |
|
68 |
+ fprintf(stderr, "ERROR: socket() error: %s\n", estr); |
|
69 |
+ */ |
|
68 | 70 |
logg("!socket() error: %s\n", estr); |
69 | 71 |
exit(1); |
70 | 72 |
} |
... | ... |
@@ -75,7 +77,9 @@ int tcpserver(const struct optstruct *opt, const struct cfgstruct *copt, struct |
75 | 75 |
|
76 | 76 |
if(bind(sockfd, (struct sockaddr *) &server, sizeof(struct sockaddr_in)) == -1) { |
77 | 77 |
estr = strerror(errno); |
78 |
- //fprintf(stderr, "ERROR: can't bind(): %s\n", estr); |
|
78 |
+ /* |
|
79 |
+ fprintf(stderr, "ERROR: can't bind(): %s\n", estr); |
|
80 |
+ */ |
|
79 | 81 |
logg("!bind() error: %s\n", estr); |
80 | 82 |
exit(1); |
81 | 83 |
} else { |
... | ... |
@@ -94,7 +98,9 @@ int tcpserver(const struct optstruct *opt, const struct cfgstruct *copt, struct |
94 | 94 |
|
95 | 95 |
if(listen(sockfd, backlog) == -1) { |
96 | 96 |
estr = strerror(errno); |
97 |
- //fprintf(stderr, "ERROR: listen() error: %s\n", estr); |
|
97 |
+ /* |
|
98 |
+ fprintf(stderr, "ERROR: listen() error: %s\n", estr); |
|
99 |
+ */ |
|
98 | 100 |
logg("!listen() error: %s\n", estr); |
99 | 101 |
exit(1); |
100 | 102 |
} |
... | ... |
@@ -99,7 +99,7 @@ void clamscan(struct optstruct *opt) |
99 | 99 |
gettimeofday(&t1, &tz); |
100 | 100 |
ret = client(opt); |
101 | 101 |
|
102 |
-//Implement STATUS in clamd |
|
102 |
+/* Implement STATUS in clamd */ |
|
103 | 103 |
if(!optl(opt, "disable-summary")) { |
104 | 104 |
gettimeofday(&t2, &tz); |
105 | 105 |
ds = t2.tv_sec - t1.tv_sec; |
... | ... |
@@ -302,7 +302,7 @@ int ole2_read_block(int fd, ole2_header_t *hdr, void *buff, int32_t blockno) |
302 | 302 |
return FALSE; |
303 | 303 |
} |
304 | 304 |
|
305 |
- // other methods: (blockno+1) * 512 or (blockno * block_size) + 512; |
|
305 |
+ /* other methods: (blockno+1) * 512 or (blockno * block_size) + 512; */ |
|
306 | 306 |
offset = (blockno << hdr->log2_big_block_size) + 512; /* 512 is header size */ |
307 | 307 |
if (lseek(fd, offset, SEEK_SET) != offset) { |
308 | 308 |
return FALSE; |
... | ... |
@@ -421,7 +421,7 @@ int32_t ole2_get_sbat_data_block(int fd, ole2_header_t *hdr, void *buff, int32_t |
421 | 421 |
return FALSE; |
422 | 422 |
} |
423 | 423 |
|
424 |
- block_count = sbat_index / 8; // 8 small blocks per big block |
|
424 |
+ block_count = sbat_index / 8; /* 8 small blocks per big block */ |
|
425 | 425 |
current_block = hdr->sbat_root_start; |
426 | 426 |
while (block_count > 0) { |
427 | 427 |
current_block = ole2_get_next_block_number(fd, hdr, current_block); |
... | ... |
@@ -503,7 +503,7 @@ int handler_writefile(int fd, ole2_header_t *hdr, property_t *prop, const char * |
503 | 503 |
char *name, *newname; |
504 | 504 |
|
505 | 505 |
if (prop->type != 2) { |
506 |
- // Not a file |
|
506 |
+ /* Not a file */ |
|
507 | 507 |
return TRUE; |
508 | 508 |
} |
509 | 509 |
|
... | ... |
@@ -538,13 +538,13 @@ int handler_writefile(int fd, ole2_header_t *hdr, property_t *prop, const char * |
538 | 538 |
|
539 | 539 |
while((current_block >= 0) && (len > 0)) { |
540 | 540 |
if (prop->size < hdr->sbat_cutoff) { |
541 |
- // Small block file |
|
541 |
+ /* Small block file */ |
|
542 | 542 |
if (!ole2_get_sbat_data_block(fd, hdr, &buff, current_block)) { |
543 | 543 |
cli_dbgmsg("ole2_get_sbat_data_block failed\n"); |
544 | 544 |
close(ofd); |
545 | 545 |
return FALSE; |
546 | 546 |
} |
547 |
- // buff now contains the block with 8 small blocks in it |
|
547 |
+ /* buff now contains the block with 8 small blocks in it */ |
|
548 | 548 |
offset = 64 * (current_block % 8); |
549 | 549 |
if (writen(ofd, &buff[offset], MIN(len,64)) != MIN(len,64)) { |
550 | 550 |
close(ofd); |
... | ... |
@@ -554,7 +554,7 @@ int handler_writefile(int fd, ole2_header_t *hdr, property_t *prop, const char * |
554 | 554 |
len -= MIN(len,64); |
555 | 555 |
current_block = ole2_get_next_sbat_block(fd, hdr, current_block); |
556 | 556 |
} else { |
557 |
- // Big block file |
|
557 |
+ /* Big block file */ |
|
558 | 558 |
if (!ole2_read_block(fd, hdr, &buff, current_block)) { |
559 | 559 |
close(ofd); |
560 | 560 |
return FALSE; |
... | ... |
@@ -192,7 +192,9 @@ int cl_loaddb(const char *filename, struct cl_node **root, int *virnum) |
192 | 192 |
fclose(fd); |
193 | 193 |
return ret; |
194 | 194 |
} |
195 |
-// cli_dbgmsg("Added part %d of partial signature (id %d)\n", i, sigid); |
|
195 |
+/* |
|
196 |
+ cli_dbgmsg("Added part %d of partial signature (id %d)\n", i, sigid); |
|
197 |
+*/ |
|
196 | 198 |
free(pt2); |
197 | 199 |
} |
198 | 200 |
|
... | ... |
@@ -418,9 +418,11 @@ int urarlib_get(void *output, |
418 | 418 |
if (ArcPtr!=NULL){ |
419 | 419 |
/* FIXME: possible FILE* leak */ |
420 | 420 |
cli_dbgmsg("%s:%d NOT Close ArcPtr from fd %d\n", __FILE__, __LINE__, desc); |
421 |
- // fclose(ArcPtr); |
|
422 |
- // lseek(desc, 0, SEEK_SET); |
|
423 |
- // ArcPtr = NULL; |
|
421 |
+ /* |
|
422 |
+ fclose(ArcPtr); |
|
423 |
+ lseek(desc, 0, SEEK_SET); |
|
424 |
+ ArcPtr = NULL; |
|
425 |
+ */ |
|
424 | 426 |
} |
425 | 427 |
#endif |
426 | 428 |
|
... | ... |
@@ -1814,66 +1816,66 @@ static void DecodeNumber(struct Decode *Deco) |
1814 | 1814 |
__asm { |
1815 | 1815 |
|
1816 | 1816 |
xor eax, eax |
1817 |
- mov eax, BitField // N=BitField & 0xFFFE; |
|
1817 |
+ mov eax, BitField /* N=BitField & 0xFFFE; */ |
|
1818 | 1818 |
and eax, 0xFFFFFFFE |
1819 | 1819 |
mov [N], eax |
1820 |
- mov edx, [Deco] // EAX=N, EDX=Deco |
|
1820 |
+ mov edx, [Deco] /* EAX=N, EDX=Deco */ |
|
1821 | 1821 |
|
1822 |
- cmp eax, dword ptr[edx + 8*4 + 4]// if (N<Dec->DecodeLen[8]) |
|
1822 |
+ cmp eax, dword ptr[edx + 8*4 + 4] /* if (N<Dec->DecodeLen[8]) */ |
|
1823 | 1823 |
jae else_G |
1824 | 1824 |
|
1825 |
- cmp eax, dword ptr[edx + 4*4 + 4]// if (N<Dec->DecodeLen[4]) |
|
1825 |
+ cmp eax, dword ptr[edx + 4*4 + 4] /* if (N<Dec->DecodeLen[4]) */ |
|
1826 | 1826 |
jae else_F |
1827 | 1827 |
|
1828 | 1828 |
|
1829 |
- cmp eax, dword ptr[edx + 2*4 + 4]// if (N<Dec->DecodeLen[2]) |
|
1829 |
+ cmp eax, dword ptr[edx + 2*4 + 4] /* if (N<Dec->DecodeLen[2]) */ |
|
1830 | 1830 |
jae else_C |
1831 | 1831 |
|
1832 |
- cmp eax, dword ptr[edx + 1*4 + 4]// if (N<Dec->DecodeLen[1]) |
|
1832 |
+ cmp eax, dword ptr[edx + 1*4 + 4] /* if (N<Dec->DecodeLen[1]) */ |
|
1833 | 1833 |
jae else_1 |
1834 |
- mov I, 1 // I=1; |
|
1834 |
+ mov I, 1 /* I=1; */ |
|
1835 | 1835 |
jmp next_1 |
1836 |
- else_1: // else |
|
1837 |
- mov I, 2 // I=2; |
|
1836 |
+ else_1: /* else */ |
|
1837 |
+ mov I, 2 /* I=2; */ |
|
1838 | 1838 |
next_1: |
1839 | 1839 |
|
1840 | 1840 |
jmp next_C |
1841 |
- else_C: // else |
|
1841 |
+ else_C: /* else */ |
|
1842 | 1842 |
|
1843 |
- cmp eax, dword ptr[edx + 3*4 + 4]// if (N<Dec->DecodeLen[3]) |
|
1843 |
+ cmp eax, dword ptr[edx + 3*4 + 4] /* if (N<Dec->DecodeLen[3]) */ |
|
1844 | 1844 |
jae else_2 |
1845 |
- mov I, 3 // I=3; |
|
1845 |
+ mov I, 3 /* I=3; */ |
|
1846 | 1846 |
jmp next_2 |
1847 |
- else_2: // else |
|
1848 |
- mov I, 4 // I=4; |
|
1847 |
+ else_2: /* else */ |
|
1848 |
+ mov I, 4 /* I=4; */ |
|
1849 | 1849 |
next_2: |
1850 | 1850 |
|
1851 |
- next_C: // else |
|
1851 |
+ next_C: /* else */ |
|
1852 | 1852 |
|
1853 | 1853 |
jmp next_F |
1854 | 1854 |
else_F: |
1855 | 1855 |
|
1856 | 1856 |
|
1857 |
- cmp eax, dword ptr[edx + 6*4 + 4]// if (N<Dec->DecodeLen[6]) |
|
1857 |
+ cmp eax, dword ptr[edx + 6*4 + 4] /* if (N<Dec->DecodeLen[6]) */ |
|
1858 | 1858 |
jae else_E |
1859 | 1859 |
|
1860 |
- cmp eax, dword ptr[edx + 5*4 + 4]// if (N<Dec->DecodeLen[5]) |
|
1860 |
+ cmp eax, dword ptr[edx + 5*4 + 4] /* if (N<Dec->DecodeLen[5]) */ |
|
1861 | 1861 |
jae else_3 |
1862 |
- mov I, 5 // I=5; |
|
1862 |
+ mov I, 5 /* I=5; */ |
|
1863 | 1863 |
jmp next_3 |
1864 |
- else_3: // else |
|
1865 |
- mov I, 6 // I=6; |
|
1864 |
+ else_3: /* else */ |
|
1865 |
+ mov I, 6 /* I=6; */ |
|
1866 | 1866 |
next_3: |
1867 | 1867 |
|
1868 | 1868 |
jmp next_E |
1869 |
- else_E: // else |
|
1869 |
+ else_E: /* else */ |
|
1870 | 1870 |
|
1871 |
- cmp eax, dword ptr[edx + 7*4 + 4]// if (N<Dec->DecodeLen[7]) |
|
1871 |
+ cmp eax, dword ptr[edx + 7*4 + 4] /* if (N<Dec->DecodeLen[7]) */ |
|
1872 | 1872 |
jae else_4 |
1873 |
- mov I, 7 // I=7; |
|
1873 |
+ mov I, 7 /* I=7; */ |
|
1874 | 1874 |
jmp next_4 |
1875 |
- else_4: // else |
|
1876 |
- mov I, 8 // I=8; |
|
1875 |
+ else_4: /* else */ |
|
1876 |
+ mov I, 8 /* I=8; */ |
|
1877 | 1877 |
next_4: |
1878 | 1878 |
|
1879 | 1879 |
next_E: |
... | ... |
@@ -1883,51 +1885,51 @@ static void DecodeNumber(struct Decode *Deco) |
1883 | 1883 |
jmp next_G |
1884 | 1884 |
else_G: |
1885 | 1885 |
|
1886 |
- cmp eax, dword ptr[edx + 12*4 + 4] // if (N<Dec->DecodeLen[12]) |
|
1886 |
+ cmp eax, dword ptr[edx + 12*4 + 4] /* if (N<Dec->DecodeLen[12]) */ |
|
1887 | 1887 |
jae else_D |
1888 | 1888 |
|
1889 |
- cmp eax, dword ptr[edx + 10*4 + 4]// if (N<Dec->DecodeLen[10]) |
|
1889 |
+ cmp eax, dword ptr[edx + 10*4 + 4] /* if (N<Dec->DecodeLen[10]) */ |
|
1890 | 1890 |
jae else_B |
1891 | 1891 |
|
1892 |
- cmp eax, dword ptr[edx + 9*4 + 4]// if (N<Dec->DecodeLen[9]) |
|
1892 |
+ cmp eax, dword ptr[edx + 9*4 + 4] /* if (N<Dec->DecodeLen[9]) */ |
|
1893 | 1893 |
jae else_5 |
1894 |
- mov I, 9 // I=9; |
|
1894 |
+ mov I, 9 /* I=9; */ |
|
1895 | 1895 |
jmp next_5 |
1896 |
- else_5: // else |
|
1897 |
- mov I, 10 // I=10; |
|
1896 |
+ else_5: /* else */ |
|
1897 |
+ mov I, 10 /* I=10; */ |
|
1898 | 1898 |
next_5: |
1899 | 1899 |
|
1900 | 1900 |
jmp next_B |
1901 |
- else_B: // else |
|
1901 |
+ else_B: /* else */ |
|
1902 | 1902 |
|
1903 |
- cmp eax, dword ptr[edx + 11*4 + 4]// if (N<Dec->DecodeLen[11]) |
|
1903 |
+ cmp eax, dword ptr[edx + 11*4 + 4] /* if (N<Dec->DecodeLen[11]) */ |
|
1904 | 1904 |
jae else_6 |
1905 |
- mov I, 11 // I=11; |
|
1905 |
+ mov I, 11 /* I=11; */ |
|
1906 | 1906 |
jmp next_6 |
1907 |
- else_6: // else |
|
1908 |
- mov I, 12 // I=12; |
|
1907 |
+ else_6: /* else */ |
|
1908 |
+ mov I, 12 /* I=12; */ |
|
1909 | 1909 |
next_6: |
1910 | 1910 |
|
1911 | 1911 |
next_B: |
1912 | 1912 |
|
1913 | 1913 |
|
1914 | 1914 |
jmp next_D |
1915 |
- else_D: // else |
|
1915 |
+ else_D: /* else */ |
|
1916 | 1916 |
|
1917 |
- cmp eax, dword ptr[edx + 14*4 + 4]// if (N<Dec->DecodeLen[14]) |
|
1917 |
+ cmp eax, dword ptr[edx + 14*4 + 4] /* if (N<Dec->DecodeLen[14]) */ |
|
1918 | 1918 |
jae else_A |
1919 | 1919 |
|
1920 |
- cmp eax, dword ptr[edx + 13*4 + 4]// if (N<Dec->DecodeLen[13]) |
|
1920 |
+ cmp eax, dword ptr[edx + 13*4 + 4] /* if (N<Dec->DecodeLen[13]) */ |
|
1921 | 1921 |
jae else_7 |
1922 |
- mov I, 13 // I=13; |
|
1922 |
+ mov I, 13 /* I=13; */ |
|
1923 | 1923 |
jmp next_7 |
1924 |
- else_7: // else |
|
1925 |
- mov I, 14 // I=14; |
|
1924 |
+ else_7: /* else */ |
|
1925 |
+ mov I, 14 /* I=14; */ |
|
1926 | 1926 |
next_7: |
1927 | 1927 |
|
1928 | 1928 |
jmp next_A |
1929 |
- else_A: // else |
|
1930 |
- mov I, 15 // I=15; |
|
1929 |
+ else_A: /* else */ |
|
1930 |
+ mov I, 15 /* I=15; */ |
|
1931 | 1931 |
next_A: |
1932 | 1932 |
|
1933 | 1933 |
next_D: |
... | ... |
@@ -2546,19 +2548,19 @@ void SetCryptKeys(char *Password) |
2546 | 2546 |
mov ebx, Offset SubstTable |
2547 | 2547 |
mov edx, ebx |
2548 | 2548 |
|
2549 |
- xor ecx, ecx // read SubstTable[N1]... |
|
2549 |
+ xor ecx, ecx /* read SubstTable[N1]... */ |
|
2550 | 2550 |
mov cl, N1 |
2551 | 2551 |
add ebx, ecx |
2552 | 2552 |
mov al, byte ptr[ebx] |
2553 | 2553 |
|
2554 |
- mov cl, N1 // read SubstTable[(N1+I+K)&0xFF]... |
|
2554 |
+ mov cl, N1 /* read SubstTable[(N1+I+K)&0xFF]... */ |
|
2555 | 2555 |
add ecx, I |
2556 | 2556 |
add ecx, K |
2557 | 2557 |
and ecx, 0xFF |
2558 | 2558 |
add edx, ecx |
2559 | 2559 |
mov ah, byte ptr[edx] |
2560 | 2560 |
|
2561 |
- mov byte ptr[ebx], ah // and write back |
|
2561 |
+ mov byte ptr[ebx], ah /* and write back */ |
|
2562 | 2562 |
mov byte ptr[edx], al |
2563 | 2563 |
|
2564 | 2564 |
} |
... | ... |
@@ -223,7 +223,7 @@ vba_project_t *vba56_dir_read(const char *dir) |
223 | 223 |
uint16_t ooff; |
224 | 224 |
uint8_t byte_count; |
225 | 225 |
uint32_t offset; |
226 |
- uint32_t LidA; //Language identifiers |
|
226 |
+ uint32_t LidA; /* Language identifiers */ |
|
227 | 227 |
uint32_t LidB; |
228 | 228 |
uint16_t CharSet; |
229 | 229 |
uint16_t LenA; |
... | ... |
@@ -16,7 +16,7 @@ |
16 | 16 |
|
17 | 17 |
#include <zzip.h> /* exported... */ |
18 | 18 |
#include <zzip-file.h> |
19 |
-#include <stddef.h> /*offsetof*/ |
|
19 |
+#include <stddef.h> /* offsetof */ |
|
20 | 20 |
#include <stdlib.h> |
21 | 21 |
#include <string.h> |
22 | 22 |
#include <errno.h> |
... | ... |
@@ -27,7 +27,9 @@ |
27 | 27 |
#include <stdio.h> |
28 | 28 |
#endif |
29 | 29 |
|
30 |
-//#include "__dirent.h" |
|
30 |
+/* |
|
31 |
+#include "__dirent.h" |
|
32 |
+*/ |
|
31 | 33 |
|
32 | 34 |
#ifndef offsetof |
33 | 35 |
#pragma warning had to DEFINE offsetof as it was not in stddef.h |
... | ... |
@@ -28,7 +28,9 @@ |
28 | 28 |
#include <ctype.h> |
29 | 29 |
|
30 | 30 |
#include <zzipformat.h> |
31 |
-//#include "__debug.h" |
|
31 |
+/* |
|
32 |
+#include "__debug.h" |
|
33 |
+*/ |
|
32 | 34 |
|
33 | 35 |
#if 0 |
34 | 36 |
# if defined ZZIP_HAVE_IO_H |
... | ... |
@@ -175,8 +177,10 @@ zzip_file_open(ZZIP_DIR * dir, zzip_char_t* name, int o_mode) |
175 | 175 |
if (n) hdr_name = n + 1; |
176 | 176 |
} |
177 | 177 |
|
178 |
- //HINT4("name='%s', compr=%d, size=%d\n", |
|
179 |
- // hdr->d_name, hdr->d_compr, hdr->d_usize); |
|
178 |
+ /* |
|
179 |
+ HINT4("name='%s', compr=%d, size=%d\n", |
|
180 |
+ hdr->d_name, hdr->d_compr, hdr->d_usize); |
|
181 |
+ */ |
|
180 | 182 |
|
181 | 183 |
if (!cmp(hdr_name, name)) |
182 | 184 |
{ |
... | ... |
@@ -28,8 +28,10 @@ |
28 | 28 |
#include <sys/stat.h> |
29 | 29 |
#endif |
30 | 30 |
|
31 |
-//#include "__mmap.h" |
|
32 |
-//#include "__debug.h" |
|
31 |
+/* |
|
32 |
+#include "__mmap.h" |
|
33 |
+#include "__debug.h" |
|
34 |
+*/ |
|
33 | 35 |
|
34 | 36 |
#define __sizeof(X) ((zzip_ssize_t)(sizeof(X))) |
35 | 37 |
|
... | ... |
@@ -94,8 +96,10 @@ _zzip_inline static void __fixup_rootseek( |
94 | 94 |
trailer->z_rootseek[1] = offset >> 8 & 0xff; |
95 | 95 |
trailer->z_rootseek[2] = offset >> 16 & 0xff; |
96 | 96 |
trailer->z_rootseek[3] = offset >> 24 & 0xff; |
97 |
- //HINT2("new rootseek=%li", |
|
98 |
- // (long) ZZIP_GET32(trailer->z_rootseek)); |
|
97 |
+ /* |
|
98 |
+ HINT2("new rootseek=%li", |
|
99 |
+ (long) ZZIP_GET32(trailer->z_rootseek)); |
|
100 |
+ */ |
|
99 | 101 |
} |
100 | 102 |
} |
101 | 103 |
#define __correct_rootseek(A,B,C) |
... | ... |
@@ -126,8 +130,11 @@ _zzip_inline static void __debug_dir_hdr (struct zzip_dir_hdr* hdr) |
126 | 126 |
* (as long as the following assertion holds...) |
127 | 127 |
*/ |
128 | 128 |
|
129 |
- //if (((unsigned)hdr)&3) |
|
130 |
- //{ NOTE1("this machine's malloc(3) returns sth. not u32-aligned"); } |
|
129 |
+ /* |
|
130 |
+ if (((unsigned)hdr)&3) |
|
131 |
+ { NOTE1("this machine's malloc(3) returns sth. not u32-aligned"); } |
|
132 |
+ */ |
|
133 |
+ |
|
131 | 134 |
/* we assume that if this machine's malloc has returned a non-aligned |
132 | 135 |
* memory block, then it is actually safe to access misaligned data, and |
133 | 136 |
* since it does only affect the first hdr it should not even bring about |
... | ... |
@@ -167,7 +174,9 @@ __zzip_find_disk_trailer(int fd, zzip_off_t filesize, |
167 | 167 |
#else |
168 | 168 |
*/ |
169 | 169 |
#define return(val) { e=val; goto cleanup; } |
170 |
-//#endif |
|
170 |
+/* |
|
171 |
+#endif |
|
172 |
+*/ |
|
171 | 173 |
register int e; |
172 | 174 |
|
173 | 175 |
#ifndef _LOWSTK |
... | ... |
@@ -251,8 +260,10 @@ __zzip_find_disk_trailer(int fd, zzip_off_t filesize, |
251 | 251 |
if (io->read(fd, buf, (zzip_size_t)maplen) < (zzip_ssize_t)maplen) |
252 | 252 |
{ return(ZZIP_DIR_READ); } |
253 | 253 |
mapped = buf; /* success */ |
254 |
- //HINT5("offs=$%lx len=%li filesize=%li pagesize=%i", |
|
255 |
- //(long)offset, (long)maplen, (long)filesize, ZZIP_BUFSIZ); |
|
254 |
+ /* |
|
255 |
+ HINT5("offs=$%lx len=%li filesize=%li pagesize=%i", |
|
256 |
+ (long)offset, (long)maplen, (long)filesize, ZZIP_BUFSIZ); |
|
257 |
+ */ |
|
256 | 258 |
} |
257 | 259 |
|
258 | 260 |
{/* now, check for the trailer-magic, hopefully near the end of file */ |
... | ... |
@@ -389,9 +400,9 @@ __zzip_parse_root_directory(int fd, |
389 | 389 |
u_comment = ZZIP_GET16(d->z_comment); |
390 | 390 |
u_namlen = ZZIP_GET16(d->z_namlen); |
391 | 391 |
u_flags = ZZIP_GET16(d->z_flags); |
392 |
- //HINT5("offset=0x%lx, size %ld, dirent *%p, hdr %p\n", |
|
393 |
- // offset+u_rootseek, (long)u_rootsize, d, hdr); |
|
394 |
- |
|
392 |
+ /*HINT5("offset=0x%lx, size %ld, dirent *%p, hdr %p\n", |
|
393 |
+ offset+u_rootseek, (long)u_rootsize, d, hdr); |
|
394 |
+ */ |
|
395 | 395 |
/* writes over the read buffer, Since the structure where data is |
396 | 396 |
copied is smaller than the data in buffer this can be done. |
397 | 397 |
It is important that the order of setting the fields is considered |
... | ... |
@@ -424,12 +435,14 @@ __zzip_parse_root_directory(int fd, |
424 | 424 |
if (offset > (long)u_rootsize) |
425 | 425 |
{ /*FAIL2("%i's end beyond root directory", entries);*/ entries--; break;} |
426 | 426 |
|
427 |
- //HINT5("file %d { compr=%d crc32=$%x offset=%d", |
|
428 |
- // entries, hdr->d_compr, hdr->d_crc32, hdr->d_off); |
|
429 |
- //HINT5("csize=%d usize=%d namlen=%d extras=%d", |
|
430 |
- // hdr->d_csize, hdr->d_usize, u_namlen, u_extras); |
|
431 |
- //HINT5("comment=%d name='%s' %s <sizeof %d> } ", |
|
432 |
- // u_comment, hdr->d_name, "",(int) sizeof(*d)); |
|
427 |
+ /* |
|
428 |
+ HINT5("file %d { compr=%d crc32=$%x offset=%d", |
|
429 |
+ entries, hdr->d_compr, hdr->d_crc32, hdr->d_off); |
|
430 |
+ HINT5("csize=%d usize=%d namlen=%d extras=%d", |
|
431 |
+ hdr->d_csize, hdr->d_usize, u_namlen, u_extras); |
|
432 |
+ HINT5("comment=%d name='%s' %s <sizeof %d> } ", |
|
433 |
+ u_comment, hdr->d_name, "",(int) sizeof(*d)); |
|
434 |
+ */ |
|
433 | 435 |
|
434 | 436 |
p_reclen = &hdr->d_reclen; |
435 | 437 |
|
... | ... |
@@ -603,18 +616,24 @@ __zzip_dir_parse (ZZIP_DIR* dir) |
603 | 603 |
* { rv = EINVAL; goto error; } |
604 | 604 |
*/ |
605 | 605 |
|
606 |
- //HINT2("------------------ fd=%i", (int) dir->fd); |
|
606 |
+ /* |
|
607 |
+ HINT2("------------------ fd=%i", (int) dir->fd); |
|
608 |
+ */ |
|
607 | 609 |
if ((filesize = dir->io->filesize(dir->fd)) < 0) |
608 | 610 |
{ rv = ZZIP_DIR_STAT; goto error; } |
609 | 611 |
|
610 |
- //HINT2("------------------ filesize=%ld", (long) filesize); |
|
612 |
+ /* |
|
613 |
+ HINT2("------------------ filesize=%ld", (long) filesize); |
|
614 |
+ */ |
|
611 | 615 |
if ((rv = __zzip_find_disk_trailer(dir->fd, filesize, &trailer, |
612 | 616 |
dir->io)) != 0) |
613 | 617 |
{ goto error; } |
614 | 618 |
|
615 |
- //HINT5("directory = { entries= %d/%d, size= %d, seek= %d } ", |
|
616 |
- // ZZIP_GET16(trailer.z_entries), ZZIP_GET16(trailer.z_finalentries), |
|
617 |
- // ZZIP_GET32(trailer.z_rootsize), ZZIP_GET32(trailer.z_rootseek)); |
|
619 |
+ /* |
|
620 |
+ HINT5("directory = { entries= %d/%d, size= %d, seek= %d } ", |
|
621 |
+ ZZIP_GET16(trailer.z_entries), ZZIP_GET16(trailer.z_finalentries), |
|
622 |
+ ZZIP_GET32(trailer.z_rootsize), ZZIP_GET32(trailer.z_rootseek)); |
|
623 |
+ */ |
|
618 | 624 |
|
619 | 625 |
if ( (rv = __zzip_parse_root_directory(dir->fd, &trailer, &dir->hdr0, |
620 | 626 |
dir->io)) != 0) |