~noskcaj/ubuntu/utopic/gjs/ppc

« back to all changes in this revision

Viewing changes to debian/patches/git_more_ppc_tests.patch

  • Committer: Jackson Doak
  • Date: 2014-09-01 06:28:33 UTC
  • Revision ID: noskcaj@ubuntu.com-20140901062833-4wlokli99y4orst8
Add git_ppc_tests.patch, git_more_ppc_tests.patch,
should allow tests to work on ppc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From c7689ebba066a5028bab7202b515a482d63a5e25 Mon Sep 17 00:00:00 2001
 
2
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel@daenzer.net>
 
3
Date: Sat, 23 Aug 2014 13:04:21 +0900
 
4
Subject: Fix JS types in more callbacks
 
5
MIME-Version: 1.0
 
6
Content-Type: text/plain; charset=UTF-8
 
7
Content-Transfer-Encoding: 8bit
 
8
 
 
9
Fixes the following JSUnit tests on PPC:
 
10
 
 
11
test0040mainloop.js
 
12
testByteArray.js
 
13
testCairo.js
 
14
testEverythingBasic.js
 
15
testFundamental.js
 
16
testGDBus.js
 
17
testGObjectClass.js
 
18
testMainloop.js
 
19
testParamSpec.js
 
20
testTweener.js
 
21
 
 
22
Signed-off-by: Michel Dänzer <michel@daenzer.net>
 
23
 
 
24
https://bugzilla.gnome.org/show_bug.cgi?id=729554
 
25
 
 
26
diff --git a/gi/param.cpp b/gi/param.cpp
 
27
index 7b4b5b5..27918b2 100644
 
28
--- a/gi/param.cpp
 
29
+++ b/gi/param.cpp
 
30
@@ -59,10 +59,10 @@ GJS_DEFINE_PRIV_FROM_JS(Param, gjs_param_class)
 
31
  */
 
32
 static JSBool
 
33
 param_new_resolve(JSContext *context,
 
34
-                  JSObject **obj,
 
35
-                  jsid      *id,
 
36
-                  unsigned   flags,
 
37
-                  JSObject **objp)
 
38
+                  JS::HandleObject obj,
 
39
+                  JS::HandleId id,
 
40
+                  unsigned flags,
 
41
+                  JS::MutableHandleObject objp)
 
42
 {
 
43
     GIObjectInfo *info = NULL;
 
44
     GIFunctionInfo *method_info;
 
45
@@ -70,12 +70,10 @@ param_new_resolve(JSContext *context,
 
46
     char *name;
 
47
     JSBool ret = JS_FALSE;
 
48
 
 
49
-    *objp = NULL;
 
50
-
 
51
-    if (!gjs_get_string_id(context, *id, &name))
 
52
+    if (!gjs_get_string_id(context, id, &name))
 
53
         return JS_TRUE; /* not resolved, but no error */
 
54
 
 
55
-    priv = priv_from_js(context, *obj);
 
56
+    priv = priv_from_js(context, obj);
 
57
 
 
58
     if (priv != NULL) {
 
59
         /* instance, not prototype */
 
60
@@ -99,12 +97,12 @@ param_new_resolve(JSContext *context,
 
61
                   "Defining method %s in prototype for GObject.ParamSpec",
 
62
                   g_base_info_get_name( (GIBaseInfo*) method_info));
 
63
 
 
64
-        if (gjs_define_function(context, *obj, G_TYPE_PARAM, method_info) == NULL) {
 
65
+        if (gjs_define_function(context, obj, G_TYPE_PARAM, method_info) == NULL) {
 
66
             g_base_info_unref( (GIBaseInfo*) method_info);
 
67
             goto out;
 
68
         }
 
69
 
 
70
-        *objp = *obj; /* we defined the prop in obj */
 
71
+        objp.set(obj); /* we defined the prop in obj */
 
72
     }
 
73
 
 
74
     g_base_info_unref( (GIBaseInfo*) method_info);
 
75
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
 
76
index 5bf922f..f4ab160 100644
 
77
--- a/gjs/importer.cpp
 
78
+++ b/gjs/importer.cpp
 
79
@@ -662,10 +662,10 @@ importer_iterator_free(ImporterIterator *iter)
 
80
  */
 
81
 static JSBool
 
82
 importer_new_enumerate(JSContext  *context,
 
83
-                       JSObject  **object,
 
84
+                       JS::HandleObject object,
 
85
                        JSIterateOp enum_op,
 
86
-                       jsval      *state_p,
 
87
-                       jsid       *id_p)
 
88
+                       JS::MutableHandleValue statep,
 
89
+                       JS::MutableHandleId idp)
 
90
 {
 
91
     ImporterIterator *iter;
 
92
 
 
93
@@ -679,20 +679,18 @@ importer_new_enumerate(JSContext  *context,
 
94
         guint32 i;
 
95
         jsid search_path_name;
 
96
 
 
97
-        if (state_p)
 
98
-            *state_p = JSVAL_NULL;
 
99
+        statep.set(JSVAL_NULL);
 
100
 
 
101
-        if (id_p)
 
102
-            *id_p = INT_TO_JSID(0);
 
103
+        idp.set(INT_TO_JSID(0));
 
104
 
 
105
-        priv = priv_from_js(context, *object);
 
106
+        priv = priv_from_js(context, object);
 
107
 
 
108
         if (!priv)
 
109
             /* we are enumerating the prototype properties */
 
110
             return JS_TRUE;
 
111
 
 
112
         search_path_name = gjs_context_get_const_string(context, GJS_STRING_SEARCH_PATH);
 
113
-        if (!gjs_object_require_property(context, *object, "importer", search_path_name, &search_path_val))
 
114
+        if (!gjs_object_require_property(context, object, "importer", search_path_name, &search_path_val))
 
115
             return JS_FALSE;
 
116
 
 
117
         if (!JSVAL_IS_OBJECT(search_path_val)) {
 
118
@@ -747,7 +745,7 @@ importer_new_enumerate(JSContext  *context,
 
119
             init_path = g_build_filename(dirname, MODULE_INIT_FILENAME,
 
120
                                          NULL);
 
121
 
 
122
-            load_module_elements(context, *object, iter, init_path);
 
123
+            load_module_elements(context, object, iter, init_path);
 
124
 
 
125
             g_free(init_path);
 
126
 
 
127
@@ -788,11 +786,9 @@ importer_new_enumerate(JSContext  *context,
 
128
             g_free(dirname);
 
129
         }
 
130
 
 
131
-        if (state_p)
 
132
-            *state_p = PRIVATE_TO_JSVAL(iter);
 
133
+        statep.set(PRIVATE_TO_JSVAL(iter));
 
134
 
 
135
-        if (id_p)
 
136
-            *id_p = INT_TO_JSID(iter->elements->len);
 
137
+        idp.set(INT_TO_JSID(iter->elements->len));
 
138
 
 
139
         break;
 
140
     }
 
141
@@ -800,15 +796,10 @@ importer_new_enumerate(JSContext  *context,
 
142
     case JSENUMERATE_NEXT: {
 
143
         jsval element_val;
 
144
 
 
145
-        if (!state_p) {
 
146
-            gjs_throw(context, "Enumerate with no iterator set?");
 
147
-            return JS_FALSE;
 
148
-        }
 
149
-
 
150
-        if (JSVAL_IS_NULL(*state_p)) /* Iterating prototype */
 
151
+        if (JSVAL_IS_NULL(statep)) /* Iterating prototype */
 
152
             return JS_TRUE;
 
153
 
 
154
-        iter = (ImporterIterator*) JSVAL_TO_PRIVATE(*state_p);
 
155
+        iter = (ImporterIterator*) JSVAL_TO_PRIVATE(statep);
 
156
 
 
157
         if (iter->index < iter->elements->len) {
 
158
             if (!gjs_string_from_utf8(context,
 
159
@@ -818,7 +809,8 @@ importer_new_enumerate(JSContext  *context,
 
160
                                          &element_val))
 
161
                 return JS_FALSE;
 
162
 
 
163
-            if (!JS_ValueToId(context, element_val, id_p))
 
164
+            jsid id = idp;
 
165
+            if (!JS_ValueToId(context, element_val, &id))
 
166
                 return JS_FALSE;
 
167
 
 
168
             break;
 
169
@@ -827,12 +819,12 @@ importer_new_enumerate(JSContext  *context,
 
170
     }
 
171
 
 
172
     case JSENUMERATE_DESTROY: {
 
173
-        if (state_p && !JSVAL_IS_NULL(*state_p)) {
 
174
-            iter = (ImporterIterator*) JSVAL_TO_PRIVATE(*state_p);
 
175
+        if (!JSVAL_IS_NULL(statep)) {
 
176
+            iter = (ImporterIterator*) JSVAL_TO_PRIVATE(statep);
 
177
 
 
178
             importer_iterator_free(iter);
 
179
 
 
180
-            *state_p = JSVAL_NULL;
 
181
+            statep.set(JSVAL_NULL);
 
182
         }
 
183
     }
 
184
     }
 
185
-- 
 
186
cgit v0.10.1