Browse code

libclamav: remove unused function File_GetLength

David Raynor authored on 2013/08/14 02:08:47
Showing 3 changed files
... ...
@@ -207,32 +207,6 @@ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
207 207
   #endif
208 208
 }
209 209
 
210
-WRes File_GetLength(CSzFile *p, UInt64 *length)
211
-{
212
-  #ifdef USE_WINDOWS_FILE
213
-  
214
-  DWORD sizeHigh;
215
-  DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
216
-  if (sizeLow == 0xFFFFFFFF)
217
-  {
218
-    DWORD res = GetLastError();
219
-    if (res != NO_ERROR)
220
-      return res;
221
-  }
222
-  *length = (((UInt64)sizeHigh) << 32) + sizeLow;
223
-  return 0;
224
-  
225
-  #else
226
-  
227
-  long pos = ftell(p->file);
228
-  int res = fseek(p->file, 0, SEEK_END);
229
-  *length = ftell(p->file);
230
-  fseek(p->file, pos, SEEK_SET);
231
-  return res;
232
-  
233
-  #endif
234
-}
235
-
236 210
 
237 211
 /* ---------- FileSeqInStream ---------- */
238 212
 
... ...
@@ -48,7 +48,6 @@ WRes File_Read(CSzFile *p, void *data, size_t *size);
48 48
 WRes File_Write(CSzFile *p, const void *data, size_t *size);
49 49
 
50 50
 WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
51
-WRes File_GetLength(CSzFile *p, UInt64 *length);
52 51
 
53 52
 
54 53
 /* ---------- FileInStream ---------- */
... ...
@@ -107,9 +107,45 @@ diff -wu lzma_orig//7zDec.c 7z/7zDec.c
107 107
  
108 108
  #include "7z.h"
109 109
  
110
+diff -wu lzma_orig//7zFile.c 7z/7zFile.c
111
+--- lzma_orig//7zFile.h	2011-06-18 01:48:31.347602680 +0200
112
+@@ -207,32 +207,6 @@
113
+   #endif
114
+ }
115
+ 
116
+-WRes File_GetLength(CSzFile *p, UInt64 *length)
117
+-{
118
+-  #ifdef USE_WINDOWS_FILE
119
+-  
120
+-  DWORD sizeHigh;
121
+-  DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
122
+-  if (sizeLow == 0xFFFFFFFF)
123
+-  {
124
+-    DWORD res = GetLastError();
125
+-    if (res != NO_ERROR)
126
+-      return res;
127
+-  }
128
+-  *length = (((UInt64)sizeHigh) << 32) + sizeLow;
129
+-  return 0;
130
+-  
131
+-  #else
132
+-  
133
+-  long pos = ftell(p->file);
134
+-  int res = fseek(p->file, 0, SEEK_END);
135
+-  *length = ftell(p->file);
136
+-  fseek(p->file, pos, SEEK_SET);
137
+-  return res;
138
+-  
139
+-  #endif
140
+-}
141
+-
142
+ 
143
+ /* ---------- FileSeqInStream ---------- */ 
144
+ 
110 145
 diff -wu lzma_orig//7zFile.h 7z/7zFile.h
111 146
 --- lzma_orig//7zFile.h	2011-06-18 01:48:31.347602680 +0200
112
-+++ 7z/7zFile.h	2011-06-18 01:27:02.229109090 +0200
113 147
 @@ -27,6 +27,7 @@
114 148
    #else
115 149
    FILE *file;
... ...
@@ -118,6 +154,14 @@ diff -wu lzma_orig//7zFile.h 7z/7zFile.h
118 118
  } CSzFile;
119 119
  
120 120
  void File_Construct(CSzFile *p);
121
+@@ -48,7 +48,6 @@
122
+ WRes File_Write(CSzFile *p, const void *data, size_t *size);
123
+ 
124
+ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
125
+-WRes File_GetLength(CSzFile *p, UInt64 *length);
126
+ 
127
+ 
128
+ /* ---------- FileInStream ---------- */
121 129
 diff -wu lzma_orig//CpuArch.h 7z/CpuArch.h
122 130
 --- lzma_orig//CpuArch.h	2011-06-18 01:48:31.363602662 +0200
123 131
 +++ 7z/CpuArch.h	2011-06-18 01:27:02.229109090 +0200