Warning cleanup. Etc.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5003 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-08-15 19:37:27 +00:00
commit f133111e79
4 changed files with 36 additions and 10 deletions

View file

@ -829,3 +829,28 @@ DohGetmark(DOH *ho) {
DohBase *h = (DohBase *) ho;
return h->flag_usermark;
}
/* -----------------------------------------------------------------------------
* DohCall()
*
* Invokes a function via DOH. A Function is represented by a hash table with
* the following attributes:
*
* "builtin" - Pointer to built-in function (if any)
*
* (Additional attributes may be added later)
*
* Returns a DOH object with result on success. Returns NULL on error
* ----------------------------------------------------------------------------- */
DOH *
DohCall(DOH *func, DOH *args) {
DOH *result;
DOH *(*builtin)(DOH *);
builtin = (DOH *(*)(DOH *)) GetVoid(func,"builtin");
if (!builtin) return 0;
result = (*builtin)(args);
return result;
}

View file

@ -104,7 +104,7 @@
#define DohNewVoid DOH_NAMESPACE(NewVoid)
#define DohSplit DOH_NAMESPACE(Split)
#define DohNone DOH_NAMESPACE(None)
#define DohCall DOH_NAMESPACE(Call)
#define DohObjMalloc DOH_NAMESPACE(ObjMalloc)
#define DohObjFree DOH_NAMESPACE(ObjFree)
#define DohMemoryDebug DOH_NAMESPACE(MemoryDebug)
@ -377,6 +377,7 @@ extern void DohMemoryDebug(void);
#define Setmark DohSetmark
#define Getmark DohGetmark
#define None DohNone
#define Call DohCall
#endif
#ifdef NIL

View file

@ -123,7 +123,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
}
break;
case 10: /* Look for a width and precision */
if (isdigit(*p) && (*p != '0')) {
if (isdigit((int)*p) && (*p != '0')) {
w = temp;
*(w++) = *p;
*(fmt++) = *p;
@ -154,7 +154,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
break;
case 20: /* Hmmm. At the start of a width field */
if (isdigit(*p)) {
if (isdigit((int)*p)) {
*(w++) = *p;
*(fmt++) = *p;
} else if (strchr(fmt_codes,*p)) {
@ -196,7 +196,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
case 40:
/* Start of precision expected */
if (isdigit(*p) && (*p != '0')) {
if (isdigit((int)*p) && (*p != '0')) {
*(fmt++) = *p;
*(w++) = *p;
state = 41;
@ -217,7 +217,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
}
break;
case 41:
if (isdigit(*p)) {
if (isdigit((int)*p)) {
*(fmt++) = *p;
*(w++) = *p;
} else if (strchr(fmt_codes,*p)) {

View file

@ -529,11 +529,11 @@ match_identifier(char *base, char *s, char *token, int tokenlen)
while (s) {
s = strstr(s,token);
if (!s) return 0;
if ((s > base) && (isalnum(*(s-1)) || (*(s-1) == '_'))) {
if ((s > base) && (isalnum((int) *(s-1)) || (*(s-1) == '_'))) {
s += tokenlen;
continue;
}
if (isalnum(*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
if (isalnum((int)*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
s += tokenlen;
continue;
}
@ -549,7 +549,7 @@ match_identifier_begin(char *base, char *s, char *token, int tokenlen)
while (s) {
s = strstr(s,token);
if (!s) return 0;
if ((s > base) && (isalnum(*(s-1)) || (*(s-1) == '_'))) {
if ((s > base) && (isalnum((int)*(s-1)) || (*(s-1) == '_'))) {
s += tokenlen;
continue;
}
@ -564,7 +564,7 @@ match_identifier_end(char *base, char *s, char *token, int tokenlen)
while (s) {
s = strstr(s,token);
if (!s) return 0;
if (isalnum(*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
if (isalnum((int)*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
s += tokenlen;
continue;
}
@ -819,7 +819,7 @@ String_chop(DOH *so)
String *str = (String *) ObjData(so);
/* Replace trailing whitespace */
c = str->str + str->len - 1;
while ((str->len > 0) && (isspace(*c))) {
while ((str->len > 0) && (isspace((int)*c))) {
if (str->sp >= str->len) {
str->sp--;
if (*c == '\n') str->line--;