aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-09-28 09:32:00 +0000
committerChristian Grothoff <christian@grothoff.org>2012-09-28 09:32:00 +0000
commite83f734557f26abbb33ef1093767ec5c24a4bf56 (patch)
tree6a8733e031205a2c41f146ffd304c6400e3c51e6 /src/util
parentd84be4e128a68baed1631736066f010c8dcf8643 (diff)
downloadgnunet-e83f734557f26abbb33ef1093767ec5c24a4bf56.tar.gz
gnunet-e83f734557f26abbb33ef1093767ec5c24a4bf56.zip
-simplify code structure for monkey
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk.c8
-rw-r--r--src/util/getopt.c5
2 files changed, 4 insertions, 9 deletions
diff --git a/src/util/disk.c b/src/util/disk.c
index 5f0e15e13..7c346dded 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -274,9 +274,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
274 LARGE_INTEGER new_pos; 274 LARGE_INTEGER new_pos;
275 BOOL b; 275 BOOL b;
276 276
277 static DWORD t[] = {[GNUNET_DISK_SEEK_SET] = FILE_BEGIN, 277 static DWORD t[] = { FILE_BEGIN, FILE_CURRENT, FILE_END };
278 [GNUNET_DISK_SEEK_CUR] = FILE_CURRENT,[GNUNET_DISK_SEEK_END] = FILE_END
279 };
280 li.QuadPart = offset; 278 li.QuadPart = offset;
281 279
282 b = SetFilePointerEx (h->h, li, &new_pos, t[whence]); 280 b = SetFilePointerEx (h->h, li, &new_pos, t[whence]);
@@ -287,9 +285,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
287 } 285 }
288 return (OFF_T) new_pos.QuadPart; 286 return (OFF_T) new_pos.QuadPart;
289#else 287#else
290 static int t[] = {[GNUNET_DISK_SEEK_SET] = SEEK_SET, 288 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END };
291 [GNUNET_DISK_SEEK_CUR] = SEEK_CUR,[GNUNET_DISK_SEEK_END] = SEEK_END
292 };
293 289
294 return lseek (h->fd, offset, t[whence]); 290 return lseek (h->fd, offset, t[whence]);
295#endif 291#endif
diff --git a/src/util/getopt.c b/src/util/getopt.c
index c37272442..415bb4b6b 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -351,7 +351,7 @@ _getopt_initialize (int argc,
351 351
352 return optstring; 352 return optstring;
353} 353}
354 354
355/* Scan elements of ARGV (whose length is ARGC) for option characters 355/* Scan elements of ARGV (whose length is ARGC) for option characters
356 given in OPTSTRING. 356 given in OPTSTRING.
357 357
@@ -767,8 +767,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring,
767 else 767 else
768 { 768 {
769 if (GNopterr) 769 if (GNopterr)
770 FPRINTF (stderr, _("\ 770 FPRINTF (stderr, _("%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name);
771%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name);
772 771
773 nextchar += strlen (nextchar); 772 nextchar += strlen (nextchar);
774 return '?'; 773 return '?';