diff options
Diffstat (limited to 'uisimulator/common/io.c')
-rw-r--r-- | uisimulator/common/io.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index d85cf680ab..5db5f52880 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -140,7 +140,7 @@ struct sim_dirent *sim_readdir(MYDIR *dir) | |||
140 | void sim_closedir(MYDIR *dir) | 140 | void sim_closedir(MYDIR *dir) |
141 | { | 141 | { |
142 | free(dir->name); | 142 | free(dir->name); |
143 | (closedir)(dir->dir); | 143 | closedir(dir->dir); |
144 | 144 | ||
145 | free(dir); | 145 | free(dir); |
146 | } | 146 | } |
@@ -155,9 +155,9 @@ int sim_open(const char *name, int o) | |||
155 | 155 | ||
156 | debugf("We open the real file '%s'\n", buffer); | 156 | debugf("We open the real file '%s'\n", buffer); |
157 | #ifdef WIN32 | 157 | #ifdef WIN32 |
158 | return (open)(buffer, opts); | 158 | return open(buffer, opts); |
159 | #else | 159 | #else |
160 | return (open)(buffer, opts, 0666); | 160 | return open(buffer, opts, 0666); |
161 | #endif | 161 | #endif |
162 | } | 162 | } |
163 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", | 163 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", |
@@ -173,7 +173,7 @@ int sim_creat(const char *name, mode_t mode) | |||
173 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | 173 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); |
174 | 174 | ||
175 | debugf("We create the real file '%s'\n", buffer); | 175 | debugf("We create the real file '%s'\n", buffer); |
176 | return (creat)(buffer, 0666); | 176 | return creat(buffer, 0666); |
177 | } | 177 | } |
178 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", | 178 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", |
179 | name); | 179 | name); |
@@ -190,9 +190,9 @@ int sim_mkdir(const char *name, mode_t mode) | |||
190 | debugf("We create the real directory '%s'\n", buffer); | 190 | debugf("We create the real directory '%s'\n", buffer); |
191 | #ifdef WIN32 | 191 | #ifdef WIN32 |
192 | /* since we build with -DNOCYGWIN we have the plain win32 version */ | 192 | /* since we build with -DNOCYGWIN we have the plain win32 version */ |
193 | return (mkdir)(buffer); | 193 | return mkdir(buffer); |
194 | #else | 194 | #else |
195 | return (mkdir)(buffer, 0666); | 195 | return mkdir(buffer, 0666); |
196 | #endif | 196 | #endif |
197 | } | 197 | } |
198 | 198 | ||
@@ -203,9 +203,9 @@ int sim_rmdir(const char *name) | |||
203 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | 203 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); |
204 | 204 | ||
205 | debugf("We remove the real directory '%s'\n", buffer); | 205 | debugf("We remove the real directory '%s'\n", buffer); |
206 | return (rmdir)(buffer); | 206 | return rmdir(buffer); |
207 | } | 207 | } |
208 | return (rmdir)(name); | 208 | return rmdir(name); |
209 | } | 209 | } |
210 | 210 | ||
211 | int sim_remove(const char *name) | 211 | int sim_remove(const char *name) |
@@ -216,9 +216,9 @@ int sim_remove(const char *name) | |||
216 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | 216 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); |
217 | 217 | ||
218 | debugf("We remove the real file '%s'\n", buffer); | 218 | debugf("We remove the real file '%s'\n", buffer); |
219 | return (remove)(buffer); | 219 | return remove(buffer); |
220 | } | 220 | } |
221 | return (remove)(name); | 221 | return remove(name); |
222 | } | 222 | } |
223 | 223 | ||
224 | int sim_rename(const char *oldpath, const char* newpath) | 224 | int sim_rename(const char *oldpath, const char* newpath) |
@@ -231,7 +231,7 @@ int sim_rename(const char *oldpath, const char* newpath) | |||
231 | sprintf(buffer2, "%s%s", SIMULATOR_ARCHOS_ROOT, newpath); | 231 | sprintf(buffer2, "%s%s", SIMULATOR_ARCHOS_ROOT, newpath); |
232 | 232 | ||
233 | debugf("We rename the real file '%s' to '%s'\n", buffer1, buffer2); | 233 | debugf("We rename the real file '%s' to '%s'\n", buffer1, buffer2); |
234 | return (rename)(buffer1, buffer2); | 234 | return rename(buffer1, buffer2); |
235 | } | 235 | } |
236 | return -1; | 236 | return -1; |
237 | } | 237 | } |
@@ -373,7 +373,8 @@ void ldebugf(const char* file, int line, const char *fmt, ...) | |||
373 | 373 | ||
374 | #endif | 374 | #endif |
375 | 375 | ||
376 | int sim_ftruncate(int fd, off_t length) | 376 | /* rockbox off_t may be different from system off_t */ |
377 | int sim_ftruncate(int fd, long length) | ||
377 | { | 378 | { |
378 | #ifdef WIN32 | 379 | #ifdef WIN32 |
379 | return _chsize(fd, length); | 380 | return _chsize(fd, length); |