projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1357dc
)
Compilation warning fixes.
author
Pekka Riikonen
<priikone@silcnet.org>
Sun, 10 Dec 2006 16:05:56 +0000
(16:05 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Sun, 10 Dec 2006 16:05:56 +0000
(16:05 +0000)
lib/silcutil/silcatomic.h
patch
|
blob
|
history
lib/silcutil/silcbuffmt.c
patch
|
blob
|
history
lib/silcutil/silcconfig.c
patch
|
blob
|
history
lib/silcutil/silcnet.c
patch
|
blob
|
history
lib/silcutil/silcschedule.c
patch
|
blob
|
history
lib/silcutil/silcutil.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/silcatomic.h
b/lib/silcutil/silcatomic.h
index b42e77a880cff32d674e36d651f778a8f4845bb2..65d8b99d142afd4c6c49c5af3d2233f2f83388e2 100644
(file)
--- a/
lib/silcutil/silcatomic.h
+++ b/
lib/silcutil/silcatomic.h
@@
-1017,8
+1017,6
@@
static inline
SilcBool silc_atomic_cas32(SilcAtomic32 *atomic, SilcUInt32 old_val,
SilcUInt32 new_val)
{
SilcBool silc_atomic_cas32(SilcAtomic32 *atomic, SilcUInt32 old_val,
SilcUInt32 new_val)
{
- SilcUInt32 ret;
-
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
@@
-1034,6
+1032,7
@@
SilcBool silc_atomic_cas32(SilcAtomic32 *atomic, SilcUInt32 old_val,
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
+ SilcUInt32 ret;
__asm __volatile("lock; cmpxchgl %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "r" (new_val), "m" (atomic->value), "0" (old_val));
__asm __volatile("lock; cmpxchgl %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "r" (new_val), "m" (atomic->value), "0" (old_val));
@@
-1081,8
+1080,6
@@
static inline
SilcBool silc_atomic_cas16(SilcAtomic16 *atomic, SilcUInt16 old_val,
SilcUInt16 new_val)
{
SilcBool silc_atomic_cas16(SilcAtomic16 *atomic, SilcUInt16 old_val,
SilcUInt16 new_val)
{
- SilcUInt16 ret;
-
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
@@
-1098,6
+1095,7
@@
SilcBool silc_atomic_cas16(SilcAtomic16 *atomic, SilcUInt16 old_val,
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
+ SilcUInt16 ret;
__asm __volatile("lock; cmpxchgw %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "c" (new_val), "m" (atomic->value), "0" (old_val));
__asm __volatile("lock; cmpxchgw %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "c" (new_val), "m" (atomic->value), "0" (old_val));
@@
-1146,8
+1144,6
@@
static inline
SilcBool silc_atomic_cas8(SilcAtomic8 *atomic, SilcUInt8 old_val,
SilcUInt8 new_val)
{
SilcBool silc_atomic_cas8(SilcAtomic8 *atomic, SilcUInt8 old_val,
SilcUInt8 new_val)
{
- SilcUInt8 ret;
-
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->value == old_val) {
@@
-1163,6
+1159,7
@@
SilcBool silc_atomic_cas8(SilcAtomic8 *atomic, SilcUInt8 old_val,
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
#elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64))
/* GCC + i486 or x86_64 */
+ SilcUInt8 ret;
__asm __volatile("lock; cmpxchgb %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "c" (new_val), "m" (atomic->value), "0" (old_val));
__asm __volatile("lock; cmpxchgb %2, %1"
: "=a" (ret), "=m" (atomic->value)
: "c" (new_val), "m" (atomic->value), "0" (old_val));
@@
-1211,8
+1208,6
@@
static inline
SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic, void *old_val,
void *new_val)
{
SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic, void *old_val,
void *new_val)
{
- void *ret;
-
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->pointer == old_val) {
#if !defined(SILC_THREADS)
/* No atomic operations */
if (atomic->pointer == old_val) {
@@
-1227,6
+1222,7
@@
SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic, void *old_val,
#elif defined(__GNUC__) && defined(SILC_I486)
/* GCC + i486 */
#elif defined(__GNUC__) && defined(SILC_I486)
/* GCC + i486 */
+ void *ret;
__asm __volatile("lock; cmpxchgl %2, %1"
: "=a" (ret), "=m" (atomic->pointer)
: "c" (new_val), "m" (atomic->pointer), "0" (old_val));
__asm __volatile("lock; cmpxchgl %2, %1"
: "=a" (ret), "=m" (atomic->pointer)
: "c" (new_val), "m" (atomic->pointer), "0" (old_val));
@@
-1234,6
+1230,7
@@
SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic, void *old_val,
#elif defined(__GNUC__) && defined(SILC_X86_64)
/* GCC + x86_64 */
#elif defined(__GNUC__) && defined(SILC_X86_64)
/* GCC + x86_64 */
+ void *ret;
__asm __volatile("lock; cmpxchgq %q2, %1"
: "=a" (ret), "=m" (atomic->pointer)
: "c" (new_val), "m" (atomic->pointer), "0" (old_val));
__asm __volatile("lock; cmpxchgq %q2, %1"
: "=a" (ret), "=m" (atomic->pointer)
: "c" (new_val), "m" (atomic->pointer), "0" (old_val));
diff --git
a/lib/silcutil/silcbuffmt.c
b/lib/silcutil/silcbuffmt.c
index e980d2b6fc199613f4ce92debac66a5e4e527d84..b17e5253d09d1de3c578ee62b9d3e2e27edc4407 100644
(file)
--- a/
lib/silcutil/silcbuffmt.c
+++ b/
lib/silcutil/silcbuffmt.c
@@
-85,8
+85,8
@@
int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap)
switch(fmt) {
case SILC_PARAM_FUNC:
{
switch(fmt) {
case SILC_PARAM_FUNC:
{
- SilcBufferFormatFunc func;
- SilcBufferSFormatFunc funcs;
+ SilcBufferFormatFunc func
= NULL
;
+ SilcBufferSFormatFunc funcs
= NULL
;
void *val;
void *context;
int tmp_len;
void *val;
void *context;
int tmp_len;
@@
-322,8
+322,8
@@
int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap)
switch(fmt) {
case SILC_PARAM_FUNC:
{
switch(fmt) {
case SILC_PARAM_FUNC:
{
- SilcBufferUnformatFunc func;
- SilcBufferSUnformatFunc funcs;
+ SilcBufferUnformatFunc func
= NULL
;
+ SilcBufferSUnformatFunc funcs
= NULL
;
void **val;
void *context;
int tmp_len;
void **val;
void *context;
int tmp_len;
diff --git
a/lib/silcutil/silcconfig.c
b/lib/silcutil/silcconfig.c
index 93e27d2d3560ac655a6300e1c34662e444124ef6..b0c4f8163d67d3fe7436fc85d4800020e2078029 100644
(file)
--- a/
lib/silcutil/silcconfig.c
+++ b/
lib/silcutil/silcconfig.c
@@
-4,7
+4,7
@@
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 2002 - 200
3
Giovanni Giacobbi
+ Copyright (C) 2002 - 200
6
Giovanni Giacobbi
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-94,7
+94,7
@@
char *silc_config_strerror(int errnum)
static void my_trim_spaces(SilcConfigFile *file)
{
register char *r = file->p;
static void my_trim_spaces(SilcConfigFile *file)
{
register char *r = file->p;
- while ((*r != '\0' && *r != EOF) && isspace(*r))
+ while ((*r != '\0' && *r != EOF) && isspace(
(int)
*r))
if (*r++ == '\n') file->line++;
file->p = r;
}
if (*r++ == '\n') file->line++;
file->p = r;
}
@@
-113,7
+113,7
@@
static char *my_next_token(SilcConfigFile *file, char *to)
register char *o;
my_trim_spaces(file);
o = file->p;
register char *o;
my_trim_spaces(file);
o = file->p;
- while (isalnum(*o) || (*o == '_') || (*o == '-'))
+ while (isalnum(
(int)
*o) || (*o == '_') || (*o == '-'))
*to++ = *o++;
*to = '\0';
file->p = o;
*to++ = *o++;
*to = '\0';
file->p = o;
@@
-208,7
+208,7
@@
static void *silc_config_marshall(SilcConfigType type, const char *val)
if (val == val_tmp)
return NULL; /* really wrong, there must be at least one digit */
/* Search for a designator */
if (val == val_tmp)
return NULL; /* really wrong, there must be at least one digit */
/* Search for a designator */
- switch (tolower(val_tmp[0])) {
+ switch (tolower(
(int)
val_tmp[0])) {
case '\0': /* None */
break;
case 'k': /* Kilobytes */
case '\0': /* None */
break;
case 'k': /* Kilobytes */
diff --git
a/lib/silcutil/silcnet.c
b/lib/silcutil/silcnet.c
index 5ef8fa82099d6ec71e8969a6805d91b7af259588..2a868d22ac37f7e0de240a850e13fb34f8fdc98b 100644
(file)
--- a/
lib/silcutil/silcnet.c
+++ b/
lib/silcutil/silcnet.c
@@
-70,7
+70,7
@@
SilcBool silc_net_is_ip4(const char *addr)
int count = 0;
while (*addr) {
int count = 0;
while (*addr) {
- if (*addr != '.' && !isdigit(*addr))
+ if (*addr != '.' && !isdigit(
(int)
*addr))
return FALSE;
if (*addr == '.')
count++;
return FALSE;
if (*addr == '.')
count++;
@@
-89,7
+89,7
@@
SilcBool silc_net_is_ip6(const char *addr)
{
/* XXX does this work with all kinds of IPv6 addresses? */
while (*addr) {
{
/* XXX does this work with all kinds of IPv6 addresses? */
while (*addr) {
- if (*addr != ':' && !isxdigit(*addr))
+ if (*addr != ':' && !isxdigit(
(int)
*addr))
return FALSE;
addr++;
}
return FALSE;
addr++;
}
diff --git
a/lib/silcutil/silcschedule.c
b/lib/silcutil/silcschedule.c
index 536cfa218ab8a3a771932610bfa4794b4700ad5d..449975207c41b0318035b5e130fc71c4a3b6f63e 100644
(file)
--- a/
lib/silcutil/silcschedule.c
+++ b/
lib/silcutil/silcschedule.c
@@
-232,8
+232,6
@@
static void silc_schedule_task_remove(SilcSchedule schedule, SilcTask task)
/* Put to free list */
silc_list_add(schedule->free_tasks, ttask);
/* Put to free list */
silc_list_add(schedule->free_tasks, ttask);
- if (silc_list_count(schedule->free_tasks) == 1)
- silc_list_start(schedule->free_tasks);
break;
}
}
break;
}
}
@@
-566,6
+564,7
@@
SilcTask silc_schedule_task_add(SilcSchedule schedule, SilcUInt32 fd,
if (type == SILC_TASK_TIMEOUT) {
SilcTaskTimeout tmp, prev, ttask;
if (type == SILC_TASK_TIMEOUT) {
SilcTaskTimeout tmp, prev, ttask;
+ silc_list_start(schedule->free_tasks);
ttask = silc_list_get(schedule->free_tasks);
if (!ttask) {
ttask = silc_calloc(1, sizeof(*ttask));
ttask = silc_list_get(schedule->free_tasks);
if (!ttask) {
ttask = silc_calloc(1, sizeof(*ttask));
diff --git
a/lib/silcutil/silcutil.c
b/lib/silcutil/silcutil.c
index ebec35a77cc2c840d5f84c728691d6fd97f36e1a..c412262452e550c2673c0f49950825bf7f497f7a 100644
(file)
--- a/
lib/silcutil/silcutil.c
+++ b/
lib/silcutil/silcutil.c
@@
-88,7
+88,7
@@
SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size)
return FALSE;
for (i = 0; i < strlen(string); i++)
return FALSE;
for (i = 0; i < strlen(string); i++)
- dest[i] =
toupper(
string[i]);
+ dest[i] =
(char)toupper((int)
string[i]);
return TRUE;
}
return TRUE;
}
@@
-103,7
+103,7
@@
SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size)
return FALSE;
for (i = 0; i < strlen(string); i++)
return FALSE;
for (i = 0; i < strlen(string); i++)
- dest[i] =
tolower(
string[i]);
+ dest[i] =
(char)tolower((int)
string[i]);
return TRUE;
}
return TRUE;
}
@@
-253,7
+253,7
@@
SilcUInt32 silc_hash_string(void *key, void *user_context)
SilcUInt32 h = 0, g;
while (*s != '\0') {
SilcUInt32 h = 0, g;
while (*s != '\0') {
- h = (h << 4) + tolower(*s);
+ h = (h << 4) + tolower(
(int)
*s);
if ((g = h & 0xf0000000)) {
h = h ^ (g >> 24);
h = h ^ g;
if ((g = h & 0xf0000000)) {
h = h ^ (g >> 24);
h = h ^ g;