Some aid for compiler warnings

This commit is contained in:
Berke Viktor
2012-07-21 14:26:19 +02:00
parent 4cae471af3
commit e7f723539d
33 changed files with 92 additions and 22 deletions

View File

@@ -30,7 +30,9 @@
#include "text.h"
#include "xchatc.h"
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#define HEXCHAT_DIR "hexchat"
#endif

View File

@@ -8,7 +8,9 @@
#include <fcntl.h>
#include <errno.h>
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

View File

@@ -40,6 +40,7 @@
#ifdef WIN32
#include <windows.h>
#include <io.h>
#else
#include <unistd.h>
#endif
@@ -803,7 +804,6 @@ static gboolean
dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
{
int er;
struct sockaddr_in addr;
#ifdef WIN32
if (condition & G_IO_ERR)
@@ -822,6 +822,8 @@ dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
}
#else
struct sockaddr_in addr;
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (dcc->port);
addr.sin_family = AF_INET;
@@ -1980,7 +1982,9 @@ dcc_change_nick (struct server *serv, char *oldnick, char *newnick)
static int
is_same_file (struct DCC *dcc, struct DCC *new_dcc)
{
#ifndef WIN32
struct stat st_a, st_b;
#endif
/* if it's the same filename, must be same */
if (strcmp (dcc->destfile, new_dcc->destfile) == 0)

View File

@@ -3,6 +3,7 @@
#include "inet.h"
#include "xchat.h"
#include "xchatc.h"
#include "text.h"
static int identd_is_running = FALSE;
#ifdef USE_IPV6

View File

@@ -23,7 +23,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

View File

@@ -23,7 +23,9 @@
#include <sys/types.h>
#include <time.h>
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

View File

@@ -24,7 +24,9 @@
#include <fcntl.h>
#include <time.h>
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

View File

@@ -54,7 +54,7 @@
#include "server.h"
#include "tree.h"
#include "outbound.h"
#include "chanopt.h"
#ifdef USE_DEBUG
extern int current_mem_usage;

View File

@@ -41,6 +41,7 @@
#include "outbound.h"
#include "util.h"
#include "xchatc.h"
#include "url.h"
static void

View File

@@ -33,12 +33,13 @@
#define WANTARPA
#include "inet.h"
#ifndef WIN32
#ifdef WIN32
#include <winbase.h>
#include <io.h>
#else
#include <signal.h>
#include <sys/wait.h>
#include <unistd.h>
#else
#include <winbase.h>
#endif
#include "xchat.h"
@@ -907,7 +908,9 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
char outbuf[512];
char host[100];
char ip[100];
#ifdef USE_MSPROXY
char *p;
#endif
waitline2 (source, tbuf, sizeof tbuf);

View File

@@ -20,12 +20,17 @@
#include "inet.h" /* make it first to avoid macro redefinitions */
#include <openssl/ssl.h> /* SSL_() */
#include <openssl/err.h> /* ERR_() */
#include <time.h> /* asctime() */
#ifdef WIN32
#include <openssl/rand.h> /* RAND_seed() */
#endif
#include <time.h> /* asctime() */
#include <string.h> /* strncpy() */
#include "ssl.h" /* struct cert_info */
#include "ssl.h" /* struct cert_info */
#include "../../config.h" /* HAVE_SNPRINTF */
#ifndef HAVE_SNPRINTF
#include <glib.h>
#include <glib/gprintf.h>
#define snprintf g_snprintf
#endif

View File

@@ -25,7 +25,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#ifndef WIN32
#ifdef WIN32
#include <io.h>
#else
#include <unistd.h>
#include <sys/mman.h>
#endif

View File

@@ -1365,10 +1365,12 @@ int my_poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) {
int
util_exec (const char *cmd)
{
int pid;
char **argv;
int argc;
#ifndef WIN32
int pid;
int fd;
#endif
if (my_poptParseArgvString (cmd, &argc, &argv) != 0)
return -1;
@@ -1398,9 +1400,9 @@ util_exec (const char *cmd)
int
util_execv (char * const argv[])
{
#ifndef WIN32
int pid, fd;
#ifndef WIN32
pid = fork ();
if (pid == -1)
return -1;