mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 23:22:16 +02:00
Enabled lots of GCC warnings, fixed those that were easy to fix.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@456 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
f8aa81b73c
commit
dcc2e89b2e
25 changed files with 84 additions and 106 deletions
|
|
@ -1,5 +1,9 @@
|
|||
noinst_LTLIBRARIES = libpopt.la
|
||||
|
||||
INCLUDES = \
|
||||
$(GLIB_CFLAGS) \
|
||||
-I$(top_srcdir)/src
|
||||
|
||||
libpopt_la_SOURCES = \
|
||||
findme.c popt.c poptconfig.c popthelp.c poptparse.c
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,8 @@
|
|||
file accompanying popt source distributions, available from
|
||||
ftp://ftp.redhat.com/pub/code/popt */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "common.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __NeXT
|
||||
/* access macros are not declared in non posix mode in unistd.h -
|
||||
don't try to use posix on NeXTstep 3.3 ! */
|
||||
|
|
@ -31,7 +25,7 @@ char * findProgramPath(char * argv0) {
|
|||
/* If there is a / in the argv[0], it has to be an absolute
|
||||
path */
|
||||
if (strchr(argv0, '/'))
|
||||
return strdup(argv0);
|
||||
return g_strdup(argv0);
|
||||
|
||||
if (!path) return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,18 +2,7 @@
|
|||
file accompanying popt source distributions, available from
|
||||
ftp://ftp.redhat.com/pub/code/popt */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "common.h"
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
|
|
@ -25,7 +14,7 @@
|
|||
|
||||
void poptSetExecPath(poptContext con, const char * path, int allowAbsolute) {
|
||||
if (con->execPath) free(con->execPath);
|
||||
con->execPath = strdup(path);
|
||||
con->execPath = g_strdup(path);
|
||||
con->execAbsolute = allowAbsolute;
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +438,7 @@ int poptGetNextOpt(poptContext con) {
|
|||
|
||||
if (opt->arg && (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE
|
||||
&& (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL)
|
||||
con->finalArgv[con->finalArgvCount++] = strdup(con->os->nextArg);
|
||||
con->finalArgv[con->finalArgvCount++] = g_strdup(con->os->nextArg);
|
||||
}
|
||||
|
||||
return opt->val;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,7 @@
|
|||
file accompanying popt source distributions, available from
|
||||
ftp://ftp.redhat.com/pub/code/popt */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "common.h"
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
|
|
@ -58,12 +49,12 @@ static void configLine(poptContext con, char * line) {
|
|||
con->execs = realloc(con->execs,
|
||||
sizeof(*con->execs) * (con->numExecs + 1));
|
||||
if (longName)
|
||||
con->execs[con->numExecs].longName = strdup(longName);
|
||||
con->execs[con->numExecs].longName = g_strdup(longName);
|
||||
else
|
||||
con->execs[con->numExecs].longName = NULL;
|
||||
|
||||
con->execs[con->numExecs].shortName = shortName;
|
||||
con->execs[con->numExecs].script = strdup(line);
|
||||
con->execs[con->numExecs].script = g_strdup(line);
|
||||
|
||||
con->numExecs++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,7 @@
|
|||
file accompanying popt source distributions, available from
|
||||
ftp://ftp.redhat.com/pub/code/popt */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "common.h"
|
||||
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
|
|
@ -302,5 +295,5 @@ void poptPrintUsage(poptContext con, FILE * f, int flags) {
|
|||
|
||||
void poptSetOtherOptionHelp(poptContext con, const char * text) {
|
||||
if (con->otherHelp) free(con->otherHelp);
|
||||
con->otherHelp = strdup(text);
|
||||
con->otherHelp = g_strdup(text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,16 +43,6 @@ struct poptContext_s {
|
|||
char * otherHelp;
|
||||
};
|
||||
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
#include <libintl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETTEXT
|
||||
#define _(foo) gettext(foo)
|
||||
#else
|
||||
#define _(foo) (foo)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DGETTEXT
|
||||
#define D_(dom, str) dgettext(dom, str)
|
||||
#define POPT_(foo) D_("popt", foo)
|
||||
|
|
@ -61,6 +51,4 @@ struct poptContext_s {
|
|||
#define D_(dom, str) (str)
|
||||
#endif
|
||||
|
||||
#define N_(foo) (foo)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue