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:
parent
5e6c2f8da2
commit
f133111e79
4 changed files with 36 additions and 10 deletions
|
|
@ -829,3 +829,28 @@ DohGetmark(DOH *ho) {
|
||||||
DohBase *h = (DohBase *) ho;
|
DohBase *h = (DohBase *) ho;
|
||||||
return h->flag_usermark;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
#define DohNewVoid DOH_NAMESPACE(NewVoid)
|
#define DohNewVoid DOH_NAMESPACE(NewVoid)
|
||||||
#define DohSplit DOH_NAMESPACE(Split)
|
#define DohSplit DOH_NAMESPACE(Split)
|
||||||
#define DohNone DOH_NAMESPACE(None)
|
#define DohNone DOH_NAMESPACE(None)
|
||||||
|
#define DohCall DOH_NAMESPACE(Call)
|
||||||
#define DohObjMalloc DOH_NAMESPACE(ObjMalloc)
|
#define DohObjMalloc DOH_NAMESPACE(ObjMalloc)
|
||||||
#define DohObjFree DOH_NAMESPACE(ObjFree)
|
#define DohObjFree DOH_NAMESPACE(ObjFree)
|
||||||
#define DohMemoryDebug DOH_NAMESPACE(MemoryDebug)
|
#define DohMemoryDebug DOH_NAMESPACE(MemoryDebug)
|
||||||
|
|
@ -377,6 +377,7 @@ extern void DohMemoryDebug(void);
|
||||||
#define Setmark DohSetmark
|
#define Setmark DohSetmark
|
||||||
#define Getmark DohGetmark
|
#define Getmark DohGetmark
|
||||||
#define None DohNone
|
#define None DohNone
|
||||||
|
#define Call DohCall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NIL
|
#ifdef NIL
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10: /* Look for a width and precision */
|
case 10: /* Look for a width and precision */
|
||||||
if (isdigit(*p) && (*p != '0')) {
|
if (isdigit((int)*p) && (*p != '0')) {
|
||||||
w = temp;
|
w = temp;
|
||||||
*(w++) = *p;
|
*(w++) = *p;
|
||||||
*(fmt++) = *p;
|
*(fmt++) = *p;
|
||||||
|
|
@ -154,7 +154,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 20: /* Hmmm. At the start of a width field */
|
case 20: /* Hmmm. At the start of a width field */
|
||||||
if (isdigit(*p)) {
|
if (isdigit((int)*p)) {
|
||||||
*(w++) = *p;
|
*(w++) = *p;
|
||||||
*(fmt++) = *p;
|
*(fmt++) = *p;
|
||||||
} else if (strchr(fmt_codes,*p)) {
|
} else if (strchr(fmt_codes,*p)) {
|
||||||
|
|
@ -196,7 +196,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
|
||||||
|
|
||||||
case 40:
|
case 40:
|
||||||
/* Start of precision expected */
|
/* Start of precision expected */
|
||||||
if (isdigit(*p) && (*p != '0')) {
|
if (isdigit((int)*p) && (*p != '0')) {
|
||||||
*(fmt++) = *p;
|
*(fmt++) = *p;
|
||||||
*(w++) = *p;
|
*(w++) = *p;
|
||||||
state = 41;
|
state = 41;
|
||||||
|
|
@ -217,7 +217,7 @@ DohvPrintf(DOH *so, const char *format, va_list ap)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 41:
|
case 41:
|
||||||
if (isdigit(*p)) {
|
if (isdigit((int)*p)) {
|
||||||
*(fmt++) = *p;
|
*(fmt++) = *p;
|
||||||
*(w++) = *p;
|
*(w++) = *p;
|
||||||
} else if (strchr(fmt_codes,*p)) {
|
} else if (strchr(fmt_codes,*p)) {
|
||||||
|
|
|
||||||
|
|
@ -529,11 +529,11 @@ match_identifier(char *base, char *s, char *token, int tokenlen)
|
||||||
while (s) {
|
while (s) {
|
||||||
s = strstr(s,token);
|
s = strstr(s,token);
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
if ((s > base) && (isalnum(*(s-1)) || (*(s-1) == '_'))) {
|
if ((s > base) && (isalnum((int) *(s-1)) || (*(s-1) == '_'))) {
|
||||||
s += tokenlen;
|
s += tokenlen;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isalnum(*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
|
if (isalnum((int)*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
|
||||||
s += tokenlen;
|
s += tokenlen;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -549,7 +549,7 @@ match_identifier_begin(char *base, char *s, char *token, int tokenlen)
|
||||||
while (s) {
|
while (s) {
|
||||||
s = strstr(s,token);
|
s = strstr(s,token);
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
if ((s > base) && (isalnum(*(s-1)) || (*(s-1) == '_'))) {
|
if ((s > base) && (isalnum((int)*(s-1)) || (*(s-1) == '_'))) {
|
||||||
s += tokenlen;
|
s += tokenlen;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -564,7 +564,7 @@ match_identifier_end(char *base, char *s, char *token, int tokenlen)
|
||||||
while (s) {
|
while (s) {
|
||||||
s = strstr(s,token);
|
s = strstr(s,token);
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
if (isalnum(*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
|
if (isalnum((int)*(s+tokenlen)) || (*(s+tokenlen) == '_')) {
|
||||||
s += tokenlen;
|
s += tokenlen;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -819,7 +819,7 @@ String_chop(DOH *so)
|
||||||
String *str = (String *) ObjData(so);
|
String *str = (String *) ObjData(so);
|
||||||
/* Replace trailing whitespace */
|
/* Replace trailing whitespace */
|
||||||
c = str->str + str->len - 1;
|
c = str->str + str->len - 1;
|
||||||
while ((str->len > 0) && (isspace(*c))) {
|
while ((str->len > 0) && (isspace((int)*c))) {
|
||||||
if (str->sp >= str->len) {
|
if (str->sp >= str->len) {
|
||||||
str->sp--;
|
str->sp--;
|
||||||
if (*c == '\n') str->line--;
|
if (*c == '\n') str->line--;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue