summaryrefslogtreecommitdiffstats
path: root/Modules/cstubs
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-10-22 12:04:32 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1993-10-22 12:04:32 (GMT)
commit3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e (patch)
treecb9c4f6b18f70822ade606f269fc043be542f5da /Modules/cstubs
parenta75d306e2b799aa891666899ca973bec82b2362b (diff)
downloadcpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.zip
cpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.tar.gz
cpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.tar.bz2
Several optimizations and speed improvements.
cstubs: Use Matrix type instead of float[4][4].
Diffstat (limited to 'Modules/cstubs')
-rw-r--r--Modules/cstubs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/cstubs b/Modules/cstubs
index d8f2d90..7e99a82 100644
--- a/Modules/cstubs
+++ b/Modules/cstubs
@@ -529,21 +529,21 @@ gl_getmatrix(self, args)
object *self;
object *args;
{
- float arg1 [ 16 ] ;
+ Matrix arg1;
object *v, *w;
- int i;
+ int i, j;
getmatrix( arg1 );
v = newlistobject(16);
if (v == NULL) {
return err_nomem();
}
- for (i = 0; i < 16; i++) {
- w = mknewfloatobject(arg1[i]);
+ for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) {
+ w = mknewfloatobject(arg1[i][j]);
if (w == NULL) {
DECREF(v);
return NULL;
}
- setlistitem(v, i, w);
+ setlistitem(v, i*4+j, w);
}
return v;
}
@@ -559,7 +559,7 @@ gl_altgetmatrix(self, args)
object *self;
object *args;
{
- float arg1 [ 4 ] [ 4 ] ;
+ Matrix arg1;
object *v, *w;
int i, j;
getmatrix( arg1 );
@@ -742,7 +742,7 @@ gl_packrect(self, args)
if (packed == NULL)
return NULL;
parray = (unsigned long *) getstringvalue(unpacked);
- p = getstringvalue(packed);
+ p = (unsigned char *) getstringvalue(packed);
for (y = 0; y < height; y += packfactor, parray += packfactor*width) {
for (x = 0; x < width; x += packfactor) {
pixel = parray[x];