From 22b79da9f678824250e98753788a959eadfcd1de Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 8 Nov 2010 14:47:06 +0000 Subject: [PATCH] seaspider fixes --- src/fs/fs_getopt.c | 8 ++++---- src/fs/fs_uri.c | 23 +++++++++++++++-------- src/util/client.c | 1 - src/util/os_priority.c | 7 ++++++- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c index edabcd06c..0db7237f7 100644 --- a/src/fs/fs_getopt.c +++ b/src/fs/fs_getopt.c @@ -144,13 +144,13 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext* *mm = meta; } - tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), #if ENABLE_NLS - nl_langinfo (CODESET) + tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), + nl_langinfo (CODESET)); #else - "utf-8" + tmp = GNUNET_STRINGS_to_utf8 (value, strlen (value), + "utf-8"); #endif - ); type = EXTRACTOR_metatype_get_max (); while (type > 0) { diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 764a2bee3..788f60685 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -240,6 +240,7 @@ percent_decode_keyword (const char *in, char **emsg) return ret; } +#define GNUNET_FS_URI_KSK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX /** * Parse a KSK URI. @@ -263,9 +264,9 @@ uri_ksk_parse (const char *s, char **emsg) GNUNET_assert (s != NULL); slen = strlen (s); - pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX); + pos = strlen (GNUNET_FS_URI_KSK_PREFIX); if ( (slen <= pos) || - (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX, + (0 != strncmp (s, GNUNET_FS_URI_KSK_PREFIX, pos) ) ) return NULL; /* not KSK URI */ if ( (s[slen - 1] == '+') || @@ -337,6 +338,8 @@ CLEANUP: } +#define GNUNET_FS_URI_SKS_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX + /** * Parse an SKS URI. * @@ -356,9 +359,9 @@ uri_sks_parse (const char *s, char **emsg) GNUNET_assert (s != NULL); slen = strlen (s); - pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX); + pos = strlen ( GNUNET_FS_URI_SKS_PREFIX); if ( (slen <= pos) || - (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX, + (0 != strncmp (s, GNUNET_FS_URI_SKS_PREFIX, pos) ) ) return NULL; /* not an SKS URI */ if ( (slen < pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)) || @@ -382,6 +385,8 @@ uri_sks_parse (const char *s, char **emsg) return ret; } +#define GNUNET_FS_URI_CHK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX + /** * Parse a CHK URI. @@ -404,9 +409,9 @@ uri_chk_parse (const char *s, char **emsg) GNUNET_assert (s != NULL); slen = strlen (s); - pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX); + pos = strlen (GNUNET_FS_URI_CHK_PREFIX); if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) || - (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX, + (0 != strncmp (s, GNUNET_FS_URI_CHK_PREFIX, pos) ) ) return NULL; /* not a CHK URI */ if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') || @@ -527,6 +532,8 @@ struct LocUriAssembly }; +#define GNUNET_FS_URI_LOC_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX + /** * Parse a LOC URI. * Also verifies validity of the location URI. @@ -553,9 +560,9 @@ uri_loc_parse (const char *s, char **emsg) GNUNET_assert (s != NULL); slen = strlen (s); - pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX); + pos = strlen ( GNUNET_FS_URI_LOC_PREFIX); if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) || - (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX, + (0 != strncmp (s, GNUNET_FS_URI_LOC_PREFIX, pos) ) ) return NULL; /* not an SKS URI */ if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') || diff --git a/src/util/client.c b/src/util/client.c index 171e9e957..d957dd00a 100644 --- a/src/util/client.c +++ b/src/util/client.c @@ -253,7 +253,6 @@ struct GNUNET_CLIENT_Connection }; - /** * Try to connect to the service. * diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 870ce28ea..fb6c2922c 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -129,11 +129,16 @@ GNUNET_OS_process_close (struct GNUNET_OS_Process *proc) extern GNUNET_SIGNAL_Handler w32_sigchld_handler; +/** + * Make seaspider happy. + */ +#define DWORD_WINAPI DWORD WINAPI + /** * @brief Waits for a process to terminate and invokes the SIGCHLD handler * @param proc pointer to process structure */ -static DWORD WINAPI +static DWORD_WINAPI ChildWaitThread (void *arg) { struct GNUNET_OS_Process *proc = (struct GNUNET_OS_Process *) arg; -- 2.25.1