Skip to content

Commit

Permalink
warnings and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vscosta committed Jun 14, 2014
1 parent 3df331a commit c41eba9
Show file tree
Hide file tree
Showing 24 changed files with 97 additions and 25 deletions.
5 changes: 4 additions & 1 deletion cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#define strtoll(s,e,b) _strtoi64(s,e,b)
#endif

install_t
install_cgi(void);

static int
isinteger(const char *s, long long *val, size_t len)
{ char *e;
Expand Down Expand Up @@ -184,6 +187,6 @@ pl_cgi_get_form(term_t form)


install_t
install_cgi()
install_cgi(void)
{ PL_register_foreign("cgi_get_form", 1, pl_cgi_get_form, 0);
}
6 changes: 5 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ case "$CPP" in
*) ACPP="$CPP"
esac
m4_ifdef([HAS_TOP],[
( CC=$ACC; LD=$ALD; CPP=$ACPP; CFLAGS=$SHLIB_CFLAGS; LDFLAGS=$LDFLAGS;
( if test x"$SYSROOT" != x; then
CC="$ACC --sysroot=$SYSROOT"; LD=$ALD; CPP="$ACPP --sysroot=$SYSROOT"; CFLAGS=$SHLIB_CFLAGS; LDFLAGS=$LDFLAGS;
else
CC=$ACC; LD=$ALD; CPP=$ACPP; CFLAGS=$SHLIB_CFLAGS; LDFLAGS=$LDFLAGS;
fi
export CC LD CFLAGS LDFLAGS;
mkdir -p packages/clib/maildrop/rfc822;
mkdir -p packages/clib/maildrop/rfc2045;
Expand Down
5 changes: 4 additions & 1 deletion crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ extern char *crypt(const char *key, const char *setting);
/* md5passwd.c */
extern char *md5_crypt(const char *pw, const char *salt);

install_t
install_crypt(void);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Simple interface to the Unix password encryption routine. Implemented
for providing authorization in the multi-threaded Prolog based HTTP
Expand Down Expand Up @@ -163,6 +166,6 @@ pl_crypt(term_t passwd, term_t encrypted)


install_t
install_crypt()
install_crypt(void)
{ PL_register_foreign("crypt", 2, pl_crypt, 0);
}
5 changes: 4 additions & 1 deletion files.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@

#endif /*__WINDOWS__*/

install_t
install_files( void );

static functor_t FUNCTOR_access1;
static functor_t FUNCTOR_modified1;
static functor_t FUNCTOR_changed1;
Expand Down Expand Up @@ -292,7 +295,7 @@ pl_link_file(term_t from, term_t to, term_t how)


install_t
install_files()
install_files( void )
{ FUNCTOR_access1 = PL_new_functor(PL_new_atom("access"), 1);
FUNCTOR_modified1 = PL_new_functor(PL_new_atom("modified"), 1);
FUNCTOR_changed1 = PL_new_functor(PL_new_atom("changed"), 1);
Expand Down
3 changes: 3 additions & 0 deletions form.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
#include <io.h>
#endif

char *
next_line(const char *in);

#include "error.h"

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
8 changes: 7 additions & 1 deletion maildrop/rfc2045/rfc2045.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@

static char *rfc2045_defcharset=0;

extern void rfc2045_enomem();
void rfc2045_add_buf(
char **bufptr, /* Buffer */
size_t *bufsize, /* Buffer's maximum size */
size_t *buflen, /* Buffer's current size */
const char *p, size_t len);
extern void rfc2045_enomem(void);
void rfc2045_add_workbuf(struct rfc2045 *h, const char *p, size_t len);

#define MAXLEVELS 20
#define MAXPARTS 300
Expand Down
2 changes: 1 addition & 1 deletion maildrop/rfc2045/rfc2045mkboundary.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
extern int gethostname(char *, size_t);
#endif

extern void rfc2045_enomem();
extern void rfc2045_enomem(void);

char *rfc2045_mk_boundary(struct rfc2045 *s, int fd)
{
Expand Down
1 change: 1 addition & 0 deletions maildrop/rfc822/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AC_SUBST(RANLIB)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_CANONICAL_HOST
AC_CHECK_TOOLS(AR, ar, ar)
AC_CHECK_TOOLS(RANLIB, ranlib, ranlib)
Expand Down
2 changes: 1 addition & 1 deletion maildrop/rfc822/rfc822_getaddrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

static void cntlen(char c, void *p)
{
c=c;
// c=c;
++ *(size_t *)p;
}

Expand Down
3 changes: 3 additions & 0 deletions maildrop/rfc822/rfc822_parsedt.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
** returns - time_t, or 0 if the date cannot be parsed
*/

time_t rfc822_parsedt(const char *rfcdt);
const char *rfc822_mkdt(time_t t);

static unsigned parsedig(const char **p)
{
unsigned i=0;
Expand Down
6 changes: 3 additions & 3 deletions md5passwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ static char rcsid[] = "$Header$";
#define MD5Update(ctx, data, len) md5_append(ctx, (md5_byte_t*)data, len)
#define MD5Final(digest, ctx) md5_finish(ctx, digest)

char *
md5_crypt(register const char *pw, register const char * salt);

static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
Expand All @@ -53,9 +55,7 @@ to64(s, v, n)
*/

char *
md5_crypt(pw, salt)
register const char *pw;
register const char *salt;
md5_crypt(register const char *pw, register const char * salt)
{
static char *magic = "$1$"; /*
* This string is magic for
Expand Down
5 changes: 4 additions & 1 deletion memfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

#define streq(s,q) (strcmp((s), (q)) == 0)

install_t
install_memfile(void);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Memory-files
Expand Down Expand Up @@ -518,7 +521,7 @@ memory_file_to_codes3(term_t handle, term_t atom, term_t encoding)
#define MKATOM(n) ATOM_ ## n = PL_new_atom(#n);

install_t
install_memfile()
install_memfile(void)
{ if ( PL_query(PL_QUERY_VERSION) <= 50505 )
{ PL_warning("Requires SWI-Prolog version 5.5.6 or later");
return;
Expand Down
4 changes: 3 additions & 1 deletion mime.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#undef max /* be sure we have ours */
#define max(x, y) ((x)>(y) ? (x) : (y))

install_t
install_mime(void);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This module defines an interface to the rfc2045 (MIME) parsing library
Expand Down Expand Up @@ -482,7 +484,7 @@ rfc2045_error(const char *errmsg)


install_t
install_mime()
install_mime(void)
{ ATOM_ = PL_new_atom("");
ATOM_stream = PL_new_atom("stream");

Expand Down
6 changes: 5 additions & 1 deletion nonblockio.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ leave the details to this function.
#include <malloc.h>
#endif

void /* allow debugger breakpoint */
tcp_debug(void);


#ifdef __WINDOWS__
Expand Down Expand Up @@ -294,6 +296,8 @@ need_retry(int error)
}
#endif

int nbio_debug(int level);

#ifdef O_DEBUG
static int debugging;

Expand All @@ -319,7 +323,7 @@ nbio_debug(int level)
#endif

void /* allow debugger breakpoint */
tcp_debug()
tcp_debug(void)
{ Sdprintf("Trapping debugger\n");
}

Expand Down
5 changes: 4 additions & 1 deletion process.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ typedef wchar_t echar; /* environment character */
typedef char echar;
#endif

install_t
install_process(void);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ISSUES:
- Deal with child errors (no cwd, cannot execute, etc.)
Expand Down Expand Up @@ -1656,7 +1659,7 @@ process_kill(term_t pid, term_t signal)
#define MKFUNCTOR(n,a) FUNCTOR_ ## n ## a = PL_new_functor(PL_new_atom(#n), a)

install_t
install_process()
install_process(void)
{
#ifdef __WINDOWS__
win_init();
Expand Down
7 changes: 6 additions & 1 deletion rlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
#include <SWI-Prolog.h>
#include "clib.h"

foreign_t
pl_rlimit(term_t what, term_t old, term_t new);
install_t
install_rlimit(void);

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Provide an interface to the Unix system resources (getrlimit()/setrlimit()).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Expand Down Expand Up @@ -123,6 +128,6 @@ pl_rlimit(term_t what, term_t old, term_t new)


install_t
install_rlimit()
install_rlimit(void)
{ PL_register_foreign("rlimit", 3, pl_rlimit, 0);
}
5 changes: 4 additions & 1 deletion sha4pl.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ static atom_t ATOM_utf8;
static atom_t ATOM_octet;
static atom_t ATOM_encoding;

install_t
install_sha4pl(void);

typedef enum
{ ALGORITHM_SHA1,
ALGORITHM_SHA224,
Expand Down Expand Up @@ -272,7 +275,7 @@ pl_hmac_sha(term_t key, term_t data, term_t mac, term_t options)
#define MKATOM(n) ATOM_ ## n = PL_new_atom(#n);

install_t
install_sha4pl()
install_sha4pl(void)
{ MKATOM(sha1); /* =160 */
MKATOM(sha224);
MKATOM(sha256);
Expand Down
10 changes: 8 additions & 2 deletions socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ static atom_t ATOM_max_message_size; /* "message_size" */

static functor_t FUNCTOR_socket1; /* $socket(Id) */

NBIO_EXPORT(int)
tcp_get_socket(term_t Socket, int *id);
install_t
install_socket(void);
install_t
uninstall_socket(void);

/*******************************
* CONVERSION *
Expand Down Expand Up @@ -672,7 +678,7 @@ pl_debug(term_t val)
#endif

install_t
install_socket()
install_socket(void)
{ nbio_init("socket");

ATOM_reuseaddr = PL_new_atom("reuseaddr");
Expand Down Expand Up @@ -713,6 +719,6 @@ install_socket()


install_t
uninstall_socket()
uninstall_socket(void)
{ nbio_cleanup();
}
4 changes: 3 additions & 1 deletion streaminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "error.h"
#include <ctype.h>

install_t install_streaminfo(void);

static int
print_byte(int value)
{ if ( isgraph(value) || isspace(value) )
Expand Down Expand Up @@ -104,6 +106,6 @@ stream_info(term_t stream)
}

install_t
install_streaminfo()
install_streaminfo(void)
{ PL_register_foreign("$stream_info", 1, stream_info, 0);
}
3 changes: 3 additions & 0 deletions syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include <syslog.h>
#include <string.h>

install_t
install_syslog(void);

#define streq(s,q) (strcmp(s,q) == 0)

static int
Expand Down
10 changes: 8 additions & 2 deletions time.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ struct timezone
{ int zone;
};

int
alarm_error(term_t alarm, int err);

static int
gettimeofday(struct timeval *tv, struct timezone *tz)
{ struct timeb tb;
Expand Down Expand Up @@ -161,7 +164,10 @@ print_trace (void)
#define DEBUG(n, g) ((void)0)
#endif /*O_DEBUG*/

install_t install_time(void);
install_t uninstall_time(void);
static void on_alarm(int sig);
int alarm_error(term_t alarm, int err);

static module_t MODULE_user;
static atom_t ATOM_remove;
Expand Down Expand Up @@ -993,7 +999,7 @@ current_alarms(term_t time, term_t goal, term_t id, term_t status,


install_t
install_time()
install_time(void)
{ MODULE_user = PL_new_module(PL_new_atom("user"));

FUNCTOR_alarm1 = PL_new_functor(PL_new_atom("$alarm"), 1);
Expand Down Expand Up @@ -1028,6 +1034,6 @@ install_time()


install_t
uninstall_time()
uninstall_time(void)
{ cleanup(0, NULL);
}
6 changes: 5 additions & 1 deletion uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>

install_t
install_uid(void);

#ifndef __WINDOWS__
#include <pwd.h>
#include <grp.h>
Expand Down Expand Up @@ -230,7 +234,7 @@ pl_setegid(term_t gid)
#endif

install_t
install_uid()
install_uid(void)
{
#ifndef __WINDOWS__
PL_register_foreign("getuid", 1, pl_getuid, 0);
Expand Down
Loading

0 comments on commit c41eba9

Please sign in to comment.