gcc warnings

This commit is contained in:
Vitor Santos Costa 2015-10-20 08:06:46 +01:00
parent cba4fdfe95
commit 20c87f1ab6
5 changed files with 11 additions and 18 deletions

View File

@ -46,7 +46,14 @@ char * Yap_blob_to_string(AtomEntry *ref, const char *s0, size_t sz)
fclose(f); // return the final result.
return s;
} else {
#if __APPLE__
size_t sz0 = strlcpy( s, (char *)RepAtom( AtomSWIStream )->StrOfAE, sz);
#else
size_t sz0;
char *f = (char *)memcpy(s, (char *)RepAtom( AtomSWIStream )->StrOfAE, sz);
f[0]='\0';
sz0 = f-s;
#endif
s = s+sz0;
sz -= sz0;
#if defined(__linux__) || defined(__APPLE__)

View File

@ -26,6 +26,7 @@ char *
findExecutable(const char *av0, char *buffer);
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <string.h>
#include <stdio.h>

View File

@ -32,6 +32,7 @@ static char SccsId[] = "@(#)save.c 1.3 3/15/90";
#include "dlmalloc.h"
#endif
#include "yapio.h"
#include "YapText.h"
#include "sshift.h"
#include "Foreign.h"
#if HAVE_STRING_H

View File

@ -454,7 +454,7 @@ static void Yap_setCurrentSourceLocation(struct stream_desc *s) {
}
/* token table with some help from Richard O'Keefe's PD scanner */
static char chtype0[NUMBER_OF_CHARS + 1] = {
char_kind_t Yap_chtype0[NUMBER_OF_CHARS + 1] = {
EF,
/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si
*/
@ -547,23 +547,6 @@ typedef struct scanner_internals {
size_t CommentsBuffLim;
} scanner_internals;
char *Yap_chtype = chtype0 + 1;
int Yap_wide_chtype(Int ch) {
#if HAVE_WCTYPE_H
if (iswalnum(ch)) {
if (iswlower(ch))
return LC;
if (iswdigit(ch))
return NU;
return UC;
}
if (iswpunct(ch))
return SY;
#endif
return BS;
}
// standard get char, uses conversion table
// and converts to wide
#define getchr(inp) inp->stream_wgetc_for_read(inp - GLOBAL_Stream)

View File

@ -131,6 +131,7 @@ BEGIN_ERRORS()
E(TYPE_ERROR_CALLABLE, TYPE_ERROR, "callable")
E(TYPE_ERROR_CHAR, TYPE_ERROR, "char")
E(TYPE_ERROR_CHARACTER, TYPE_ERROR, "character")
E(TYPE_ERROR_CHARACTER_CODE, TYPE_ERROR, "character_code")
E(TYPE_ERROR_COMPOUND, TYPE_ERROR, "compound")
E(TYPE_ERROR_DBREF, TYPE_ERROR, "dbref")
E(TYPE_ERROR_DBTERM, TYPE_ERROR, "dbterm")