Don't return 0 in place of NULL

This commit is contained in:
TingPing 2014-12-31 11:31:17 -05:00
parent 112632bb4e
commit 2a28289314
9 changed files with 25 additions and 25 deletions

View File

@ -207,10 +207,10 @@ cfg_get_str (char *cfg, const char *var, char *dest, int dest_len)
while (*cfg != 0 && *cfg != '\n') while (*cfg != 0 && *cfg != '\n')
cfg++; cfg++;
if (*cfg == 0) if (*cfg == 0)
return 0; return NULL;
cfg++; cfg++;
if (*cfg == 0) if (*cfg == 0)
return 0; return NULL;
} }
} }

View File

@ -494,7 +494,7 @@ dcc_write_chat (char *nick, char *text)
fe_dcc_update (dcc); fe_dcc_update (dcc);
return dcc; return dcc;
} }
return 0; return NULL;
} }
/* returns: 0 - ok /* returns: 0 - ok
@ -1936,7 +1936,7 @@ find_dcc_from_id (int id, int type)
return dcc; return dcc;
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static struct DCC * static struct DCC *
@ -1952,7 +1952,7 @@ find_dcc_from_port (int port, int type)
return dcc; return dcc;
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
struct DCC * struct DCC *
@ -1977,7 +1977,7 @@ find_dcc (char *nick, char *file, int type)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
/* called when we receive a NICK change from server */ /* called when we receive a NICK change from server */

View File

@ -209,7 +209,7 @@ find_dialog (server *serv, char *nick)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
session * session *
@ -227,7 +227,7 @@ find_channel (server *serv, char *chan)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static void static void

View File

@ -52,7 +52,7 @@ history_down (struct history *his)
int next; int next;
if (his->pos == his->realpos) /* allow down only after up */ if (his->pos == his->realpos) /* allow down only after up */
return 0; return NULL;
if (his->realpos == 0) if (his->realpos == 0)
{ {
if (his->pos == HISTORY_SIZE - 1) if (his->pos == HISTORY_SIZE - 1)
@ -79,7 +79,7 @@ history_down (struct history *his)
return his->lines[his->pos]; return his->lines[his->pos];
} }
return 0; return NULL;
} }
char * char *
@ -90,11 +90,11 @@ history_up (struct history *his, char *current_text)
if (his->realpos == HISTORY_SIZE - 1) if (his->realpos == HISTORY_SIZE - 1)
{ {
if (his->pos == 0) if (his->pos == 0)
return 0; return NULL;
} else } else
{ {
if (his->pos == his->realpos + 1) if (his->pos == his->realpos + 1)
return 0; return NULL;
} }
next = HISTORY_SIZE - 1; next = HISTORY_SIZE - 1;
@ -117,5 +117,5 @@ history_up (struct history *his, char *current_text)
return his->lines[his->pos]; return his->lines[his->pos];
} }
return 0; return NULL;
} }

View File

@ -118,7 +118,7 @@ find_session_from_nick (char *nick, server *serv)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static session * static session *
@ -555,7 +555,7 @@ find_unused_session (server *serv)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static session * static session *
@ -573,7 +573,7 @@ find_session_from_waitchannel (char *chan, struct server *serv)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
void void
@ -932,7 +932,7 @@ find_session_from_type (int type, server *serv)
return sess; return sess;
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
void void

View File

@ -196,7 +196,7 @@ notify_find (server *serv, char *nick)
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static void static void

View File

@ -1654,7 +1654,7 @@ memrchr (const void *block, int c, size_t size)
for (p = (unsigned char *)block + size; p != block; p--) for (p = (unsigned char *)block + size; p != block; p--)
if (*p == c) if (*p == c)
return p; return p;
return 0; return NULL;
} }
#endif #endif

View File

@ -221,7 +221,7 @@ userlist_find_global (struct server *serv, char *name)
} }
list = list->next; list = list->next;
} }
return 0; return NULL;
} }
static void static void

View File

@ -951,7 +951,7 @@ gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off,
line = (y + xtext->pixel_offset) / xtext->fontsize; line = (y + xtext->pixel_offset) / xtext->fontsize;
ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline); ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline);
if (!ent) if (!ent)
return 0; return NULL;
if (off) if (off)
*off = gtk_xtext_find_x (xtext, x, ent, subline, line, out_of_bounds); *off = gtk_xtext_find_x (xtext, x, ent, subline, line, out_of_bounds);
@ -1588,11 +1588,11 @@ gtk_xtext_get_word (GtkXText * xtext, int x, int y, textentry ** ret_ent,
/* make sure we're not before the start of the match */ /* make sure we're not before the start of the match */
if (len_to_offset < start) if (len_to_offset < start)
return 0; return NULL;
/* and not after it */ /* and not after it */
if (len_to_offset - start >= end - start) if (len_to_offset - start >= end - start)
return 0; return NULL;
} }
return word; return word;
@ -3646,7 +3646,7 @@ gtk_xtext_nth (GtkXText *xtext, int line, int *subline)
break; break;
lines -= g_slist_length (ent->sublines); lines -= g_slist_length (ent->sublines);
} }
return 0; return NULL;
} }
} }
/* -- end of optimization -- */ /* -- end of optimization -- */
@ -3661,7 +3661,7 @@ gtk_xtext_nth (GtkXText *xtext, int line, int *subline)
} }
ent = ent->next; ent = ent->next;
} }
return 0; return NULL;
} }
/* render enta (or an inclusive range enta->entb) */ /* render enta (or an inclusive range enta->entb) */