Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76a00af

Browse files
committed
Support for long integers
1 parent a049031 commit 76a00af

2 files changed

Lines changed: 18 additions & 28 deletions

File tree

Modules/cgensupport.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2424

2525
/* Functions used by cgen output */
2626

27-
#include <stdio.h>
28-
29-
#include "PROTO.h"
30-
#include "object.h"
31-
#include "intobject.h"
32-
#include "floatobject.h"
33-
#include "stringobject.h"
34-
#include "tupleobject.h"
35-
#include "listobject.h"
36-
#include "methodobject.h"
37-
#include "moduleobject.h"
38-
#include "modsupport.h"
39-
#include "import.h"
27+
#include "allobjects.h"
4028
#include "cgensupport.h"
41-
#include "errors.h"
4229

4330

4431
/* Functions to construct return values */
@@ -130,6 +117,10 @@ extractdouble(v, p_arg)
130117
*p_arg = GETINTVALUE((intobject *)v);
131118
return 1;
132119
}
120+
else if (is_longobject(v)) {
121+
*p_arg = dgetlongvalue(v);
122+
return 1;
123+
}
133124
return err_badarg();
134125
}
135126

@@ -149,6 +140,10 @@ extractfloat(v, p_arg)
149140
*p_arg = GETINTVALUE((intobject *)v);
150141
return 1;
151142
}
143+
else if (is_longobject(v)) {
144+
*p_arg = dgetlongvalue(v);
145+
return 1;
146+
}
152147
return err_badarg();
153148
}
154149

Python/cgensupport.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2424

2525
/* Functions used by cgen output */
2626

27-
#include <stdio.h>
28-
29-
#include "PROTO.h"
30-
#include "object.h"
31-
#include "intobject.h"
32-
#include "floatobject.h"
33-
#include "stringobject.h"
34-
#include "tupleobject.h"
35-
#include "listobject.h"
36-
#include "methodobject.h"
37-
#include "moduleobject.h"
38-
#include "modsupport.h"
39-
#include "import.h"
27+
#include "allobjects.h"
4028
#include "cgensupport.h"
41-
#include "errors.h"
4229

4330

4431
/* Functions to construct return values */
@@ -130,6 +117,10 @@ extractdouble(v, p_arg)
130117
*p_arg = GETINTVALUE((intobject *)v);
131118
return 1;
132119
}
120+
else if (is_longobject(v)) {
121+
*p_arg = dgetlongvalue(v);
122+
return 1;
123+
}
133124
return err_badarg();
134125
}
135126

@@ -149,6 +140,10 @@ extractfloat(v, p_arg)
149140
*p_arg = GETINTVALUE((intobject *)v);
150141
return 1;
151142
}
143+
else if (is_longobject(v)) {
144+
*p_arg = dgetlongvalue(v);
145+
return 1;
146+
}
152147
return err_badarg();
153148
}
154149

0 commit comments

Comments
 (0)