summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-09 19:24:53 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-09 19:24:53 (GMT)
commit644a12b00ce6a361089b488aa8096a6c86b52275 (patch)
tree73e3cfeeba809a3fc43f42d1883ebe9dffe3ffda /Python
parent801776742082034cc6193530326af042d5af56a5 (diff)
downloadcpython-644a12b00ce6a361089b488aa8096a6c86b52275.zip
cpython-644a12b00ce6a361089b488aa8096a6c86b52275.tar.gz
cpython-644a12b00ce6a361089b488aa8096a6c86b52275.tar.bz2
Tweaks to keep the Microsoft compiler quier.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
-rw-r--r--Python/importdl.c3
-rw-r--r--Python/mystrtoul.c2
-rw-r--r--Python/structmember.c14
4 files changed, 16 insertions, 8 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 7d9a3a8..21629ab 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -182,6 +182,9 @@ typeobject Codetype = {
(hashfunc)code_hash, /*tp_hash*/
};
+#define NAME_CHARS \
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
+
codeobject *
newcodeobject(argcount, nlocals, stacksize, flags,
code, consts, names, varnames, filename, name,
@@ -237,7 +240,7 @@ newcodeobject(argcount, nlocals, stacksize, flags,
if (!is_stringobject(v))
continue;
p = getstringvalue(v);
- if (strspn(p, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
+ if ((int)strspn(p, NAME_CHARS)
!= getstringsize(v))
continue;
PyString_InternInPlace(&PyTuple_GET_ITEM(consts, i));
diff --git a/Python/importdl.c b/Python/importdl.c
index 2abef33..02f87dc 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -503,13 +503,16 @@ load_dynamic_module(name, pathname, fp)
perror(funcname);
}
#endif /* hpux */
+#ifdef USE_SHLIB
got_it:
+#endif
if (p == NULL) {
err_setstr(ImportError,
"dynamic module does not define init function");
return NULL;
}
(*p)();
+ /* XXX Need check for err_occurred() here */
m = dictlookup(import_modules, name);
if (m == NULL) {
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index a869b46..ed0e526 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -141,7 +141,7 @@ int base;
*ptr = str;
if (ovf)
{
- result = ~0;
+ result = (unsigned long) ~0L;
errno = ERANGE;
}
return result;
diff --git a/Python/structmember.c b/Python/structmember.c
index 7e24fa5..f5cca97 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -186,7 +186,7 @@ setmember(addr, mlist, name, v)
err_badarg();
return -1;
}
- *(char*)addr = getintvalue(v);
+ *(char*)addr = (char) getintvalue(v);
break;
case T_SHORT:
case T_USHORT:
@@ -194,7 +194,7 @@ setmember(addr, mlist, name, v)
err_badarg();
return -1;
}
- *(short*)addr = getintvalue(v);
+ *(short*)addr = (short) getintvalue(v);
break;
case T_UINT:
case T_INT:
@@ -202,7 +202,7 @@ setmember(addr, mlist, name, v)
err_badarg();
return -1;
}
- *(int*)addr = getintvalue(v);
+ *(int*)addr = (int) getintvalue(v);
break;
case T_LONG:
if (!is_intobject(v)) {
@@ -223,9 +223,10 @@ setmember(addr, mlist, name, v)
break;
case T_FLOAT:
if (is_intobject(v))
- *(float*)addr = getintvalue(v);
+ *(float*)addr = (float) getintvalue(v);
else if (is_floatobject(v))
- *(float*)addr = getfloatvalue(v);
+ *(float*)addr =
+ (float) getfloatvalue(v);
else {
err_badarg();
return -1;
@@ -233,7 +234,8 @@ setmember(addr, mlist, name, v)
break;
case T_DOUBLE:
if (is_intobject(v))
- *(double*)addr = getintvalue(v);
+ *(double*)addr =
+ (double) getintvalue(v);
else if (is_floatobject(v))
*(double*)addr = getfloatvalue(v);
else {