summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-11-23 17:53:17 (GMT)
committerGuido van Rossum <guido@python.org>1993-11-23 17:53:17 (GMT)
commitb376a4ad1848d1319245f440c85ef265e1fef401 (patch)
treedc431ee0a195eb95dacec0edd25fdc1f1b7edd8e /Objects
parent83eb962528e61dadd75cfc38e0aa6469d91d1a66 (diff)
downloadcpython-b376a4ad1848d1319245f440c85ef265e1fef401.zip
cpython-b376a4ad1848d1319245f440c85ef265e1fef401.tar.gz
cpython-b376a4ad1848d1319245f440c85ef265e1fef401.tar.bz2
* timemodule.c: Add hack for Solaris 2.
* posixmodule.c: don't prototype getcwd() -- it's not portable... * mappingobject.c: double-check validity of last_name_char in dict{lookup,insert,remove}. * arraymodule.c: need memmove only for non-STDC Suns. * Makefile: comment out HTML_LIBS and XT_USE by default * pythonmain.c: don't prototype getopt() -- it's not standardized * socketmodule.c: cast flags arg to {get,set}sockopt() and addrbuf arg to recvfrom() to (ANY*). * pythonrun.c (initsigs): fix prototype, make it static * intobject.c (LONG_BIT): only #define it if not already defined * classobject.[ch]: remove all references to unused instance_convert() * mappingobject.c (getmappingsize): Don't return NULL in int function.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c8
-rw-r--r--Objects/dictobject.c9
-rw-r--r--Objects/intobject.c2
-rw-r--r--Objects/mappingobject.c9
4 files changed, 12 insertions, 16 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 6008999..268cf1a 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -960,14 +960,6 @@ typeobject Instancetype = {
instance_hash, /*tp_hash*/
};
-static object *
-instance_convert(inst, methodname)
- object *inst;
- char *methodname;
-{
- return generic_unary_op((instanceobject *)inst, methodname);
-}
-
/* Instance method objects are used for two purposes:
(a) as bound instance methods (returned by instancename.methodname)
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 65512be..972560d 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -572,7 +572,7 @@ getmappingsize(mp)
{
if (mp == NULL || !is_mappingobject(mp)) {
err_badcall();
- return NULL;
+ return 0;
}
return ((mappingobject *)mp)->ma_used;
}
@@ -773,7 +773,7 @@ dictlookup(v, key)
object *v;
char *key;
{
- if (key != last_name_char) {
+ if (key != last_name_char || strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {
@@ -791,7 +791,7 @@ dictinsert(v, key, item)
char *key;
object *item;
{
- if (key != last_name_char) {
+ if (key != last_name_char || strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {
@@ -808,7 +808,8 @@ dictremove(v, key)
object *v;
char *key;
{
- if (key != last_name_char) {
+ if (key != last_name_char ||
+ strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 2953ffa..e9c35d7 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -43,7 +43,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define CHAR_BIT 8
#endif
+#ifndef LONG_BIT
#define LONG_BIT (CHAR_BIT * sizeof(long))
+#endif
/* Standard Booleans */
diff --git a/Objects/mappingobject.c b/Objects/mappingobject.c
index 65512be..972560d 100644
--- a/Objects/mappingobject.c
+++ b/Objects/mappingobject.c
@@ -572,7 +572,7 @@ getmappingsize(mp)
{
if (mp == NULL || !is_mappingobject(mp)) {
err_badcall();
- return NULL;
+ return 0;
}
return ((mappingobject *)mp)->ma_used;
}
@@ -773,7 +773,7 @@ dictlookup(v, key)
object *v;
char *key;
{
- if (key != last_name_char) {
+ if (key != last_name_char || strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {
@@ -791,7 +791,7 @@ dictinsert(v, key, item)
char *key;
object *item;
{
- if (key != last_name_char) {
+ if (key != last_name_char || strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {
@@ -808,7 +808,8 @@ dictremove(v, key)
object *v;
char *key;
{
- if (key != last_name_char) {
+ if (key != last_name_char ||
+ strcmp(key, getstringvalue(last_name_object)) != 0) {
XDECREF(last_name_object);
last_name_object = newstringobject(key);
if (last_name_object == NULL) {