Skip to content
Newer
Older
100644 451 lines (280 sloc) 8.45 KB
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
1 /*
0e36289 @allisonrandal [cage] Updating all copyrights in src/ to Parrot Foundation.
allisonrandal authored Feb 17, 2009
2 Copyright (C) 2001-2009, Parrot Foundation.
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
3 $Id$
4
5 =head1 NAME
6
f474cd7 @bschmalhofer [perl #38235] Rename (dyn)?classes to (dyn)?pmc
bschmalhofer authored Jan 18, 2006
7 src/pmc/fixedfloatarray.pmc - fixed size array for floating point numbers only
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
8
9 =head1 DESCRIPTION
10
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
11 This class, FixedFloatArray, implements an array of fixed size which
12 stored FLOATVALs. It uses Float PMCs to do all necessary conversions.
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
13
14 =head2 Functions
15
16 =over 4
17
18 =cut
19
20 */
21
6b81760 @Whiteknight [pmc] we don't need need_ext anymore, so BALEETED
Whiteknight authored Aug 23, 2009
22 pmclass FixedFloatArray auto_attrs provides array {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
23 ATTR INTVAL size;
24 ATTR FLOATVAL *float_array;
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
25
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
26 /*
27
28 =back
29
30 =head2 Methods
31
32 =over 4
33
34 =item C<void destroy()>
35
36 Destroys the array.
37
38 =cut
39
40 */
41
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
42 VTABLE void destroy() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
43 FLOATVAL *float_array;
44 GET_ATTR_float_array(INTERP, SELF, float_array);
45 if (float_array)
4833868 @bacek Merge branch 'sys_mem' into trunk
bacek authored Feb 22, 2010
46 mem_gc_free(INTERP, float_array);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
47 }
48
49 /*
50
51 =item C<PMC *clone()>
52
53 Creates and returns a copy of the array.
54
55 =cut
56
57 */
58
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
59 VTABLE PMC *clone() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
60 INTVAL size;
61 FLOATVAL *self_float_array, *dest_float_array;
cc7c3b2 @pmichaud [core]:
pmichaud authored Sep 11, 2007
62 size_t mem_size;
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored Feb 16, 2010
63 PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
64 GET_ATTR_float_array(INTERP, SELF, self_float_array);
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
65
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
66 if (!self_float_array)
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
67 return dest;
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
68
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
69 GET_ATTR_size(INTERP, SELF, size);
70 SET_ATTR_size(INTERP, dest, size);
cc7c3b2 @pmichaud [core]:
pmichaud authored Sep 11, 2007
71 mem_size = size * sizeof (FLOATVAL);
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
72
4833868 @bacek Merge branch 'sys_mem' into trunk
bacek authored Feb 22, 2010
73 dest_float_array = (FLOATVAL*)Parrot_gc_allocate_memory_chunk(INTERP, mem_size);
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
74 mem_sys_memcopy(dest_float_array, self_float_array, mem_size);
75 SET_ATTR_float_array(INTERP, dest, dest_float_array);
4591dbb @chromatic [HLL] Fixed two compilation-breaking typos accidentally committed in …
chromatic authored Sep 3, 2009
76 PObj_custom_destroy_SET(dest);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
77
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
78 return dest;
79 }
80
81 /*
82
c2b50bf @cotto [PMC] add get_iter + tests to *FloatArray
cotto authored Mar 22, 2009
83 =item C<PMC *get_iter()>
84
85 Return an Iterator for this PMC.
86
87 =cut
88
89 */
90
91 VTABLE PMC *get_iter() {
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored Feb 16, 2010
92 return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
c2b50bf @cotto [PMC] add get_iter + tests to *FloatArray
cotto authored Mar 22, 2009
93 }
94
95 /*
96
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
97 =item C<INTVAL get_bool()>
98
99 Returns whether the array has any elements (meaning been initialized, for a
100 fixed sized array).
101
102 =cut
103
104 */
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
105 VTABLE INTVAL get_bool() {
a35f6fd @petdance consting & localizing
petdance authored Feb 9, 2008
106 const INTVAL size = SELF.elements();
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
107 return (INTVAL)(size != 0);
108 }
109
110 /*
111
112 =item C<INTVAL elements()>
113
114 =cut
115
116 */
117
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
118 VTABLE INTVAL elements() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
119 INTVAL size;
120 GET_ATTR_size(INTERP, SELF, size);
121 return size;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
122 }
123
124 /*
125
126 =item C<INTVAL get_integer()>
127
128 Returns the number of elements in the array.
129
130 =cut
131
132 */
133
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
134 VTABLE INTVAL get_integer() {
ae8baa5 @bschmalhofer DYNDYNSELF in the Fixed*Array PMC looks like a typo. Using SELF propably
bschmalhofer authored Mar 20, 2005
135 return SELF.elements();
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
136 }
137
138
139 /*
140
141 =item C<INTVAL get_integer_keyed_int(INTVAL key)>
142
143 Returns the integer value of the element at index C<key>.
144
145 =cut
146
147 */
148
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
149 VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
150 const FLOATVAL f = SELF.get_number_keyed_int(key);
8275ff5 @chromatic [PMC] Fixed a couple of casting warnings of function return values.
chromatic authored Aug 18, 2007
151 return (INTVAL)f;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
152 }
153
154 /*
155
156 =item C<INTVAL get_integer_keyed(PMC *key)>
157
158 Returns the integer value of the element at index C<*key>.
159
160 =cut
161
162 */
163
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
164 VTABLE INTVAL get_integer_keyed(PMC *key) {
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
165 /* simple int keys only */
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
166 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
167 return SELF.get_integer_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
168 }
169
170
171 /*
172
173 =item C<FLOATVAL get_number_keyed_int(INTVAL key)>
174
175 Returns the floating-point value of the element at index C<key>.
176
177 =cut
178
179 */
180
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
181 VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
182 FLOATVAL *float_array;
183 INTVAL size;
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
184
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
185 GET_ATTR_size(INTERP, SELF, size);
186 if (key < 0 || key >= size)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
187 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
d185452 @chromatic Standardize internal exception calls (James deBoer, james at huronbox…
chromatic authored Dec 12, 2004
188 "FixedFloatArray: index out of bounds!");
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
189
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
190 GET_ATTR_float_array(INTERP, SELF, float_array);
191 return float_array[key];
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
192 }
193
194 /*
195
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored Aug 9, 2007
196 =item C<FLOATVAL get_number_keyed(PMC *key)>
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
197
198 Returns the floating-point value of the element at index C<*key>.
199
200 =cut
201
202 */
203
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
204 VTABLE FLOATVAL get_number_keyed(PMC *key) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
205 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
206 return SELF.get_number_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
207 }
208
209 /*
210
211 =item C<STRING *get_string_keyed_int(INTVAL key)>
212
213 Returns the Parrot string value of the element at index C<key>.
214
215 =cut
216
217 */
218
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
219 VTABLE STRING *get_string_keyed_int(INTVAL key) {
220 PMC * const e = SELF.get_pmc_keyed_int(key);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
221 return VTABLE_get_string(INTERP, e);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
222 }
223
224 /*
225
226 =item C<STRING *get_string_keyed(PMC *key)>
227
228 Returns the Parrot string value of the element at index C<*key>.
229
230 =cut
231
232 */
233
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
234 VTABLE STRING *get_string_keyed(PMC *key) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
235 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
236 return SELF.get_string_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
237 }
238
239
240 /*
241
242 =item C<PMC *get_pmc_keyed_int(INTVAL key)>
243
244 Returns the PMC value of the element at index C<key>.
245
246 =cut
247
248 */
249
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
250 VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored Feb 16, 2010
251 PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Float);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
252 const FLOATVAL val = SELF.get_number_keyed_int(key);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
253
254 VTABLE_set_number_native(INTERP, ret, val);
255 return ret;
256 }
257
258 /*
259
260 =item C<PMC *get_pmc_keyed(PMC *key)>
261
262 Returns the PMC value of the element at index C<*key>.
263
264 =cut
265
266 */
267
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
268 VTABLE PMC *get_pmc_keyed(PMC *key) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
269 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
270 return SELF.get_pmc_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
271 }
272
273 /*
274
275 =item C<void set_integer_native(INTVAL size)>
276
277 Resizes the array to C<size> elements.
278
279 =cut
280
281 */
282
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
283 VTABLE void set_integer_native(INTVAL new_size) {
284 INTVAL old_size;
285 GET_ATTR_size(INTERP, SELF, old_size);
286 if (old_size || new_size < 1)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
287 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
288 "FixedFloatArray: Can't resize!");
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored Sep 4, 2007
289
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
290 SET_ATTR_size(INTERP, SELF, new_size);
1bc2b58 @bschmalhofer [codingstd] trailing_space.t
bschmalhofer authored Jan 25, 2009
291 SET_ATTR_float_array(INTERP, SELF,
4833868 @bacek Merge branch 'sys_mem' into trunk
bacek authored Feb 22, 2010
292 mem_gc_allocate_n_typed(INTERP, new_size, FLOATVAL));
4591dbb @chromatic [HLL] Fixed two compilation-breaking typos accidentally committed in …
chromatic authored Sep 3, 2009
293 PObj_custom_destroy_SET(SELF);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
294 }
295
296 /*
297
298 =item C<void set_integer_keyed_int(INTVAL key, INTVAL value)>
299
300 Sets the integer value of the element at index C<key> to C<value>.
301
302 =cut
303
304 */
305
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
306 VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
307 SELF.set_number_keyed_int(key, (FLOATVAL)value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
308 }
309
310 /*
311
312 =item C<void set_integer_keyed(PMC *key, INTVAL value)>
313
314 Sets the integer value of the element at index C<key> to C<value>.
315
316 =cut
317
318 */
319
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
320 VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
321 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
322 SELF.set_integer_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
323 }
324
325 /*
326
327 =item C<void set_number_keyed_int(INTVAL key, FLOATVAL value)>
328
329 Sets the floating-point value of the element at index C<key> to
330 C<value>.
331
332 =cut
333
334 */
335
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
336 VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
337 FLOATVAL *float_array;
338 INTVAL size;
339
340 GET_ATTR_size(INTERP, SELF, size);
341 if (key < 0 || key >= size)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored Aug 2, 2008
342 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
d185452 @chromatic Standardize internal exception calls (James deBoer, james at huronbox…
chromatic authored Dec 12, 2004
343 "FixedFloatArray: index out of bounds!");
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
344
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored Jan 25, 2009
345 GET_ATTR_float_array(INTERP, SELF, float_array);
346 float_array[key] = value;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
347 }
348
349 /*
350
351 =item C<void set_number_keyed(PMC *key, FLOATVAL value)>
352
353 Sets the floating-point value of the element at index C<key> to
354 C<value>.
355
356 =cut
357
358 */
359
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
360 VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
361 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
362 SELF.set_number_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
363 }
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to r…
particle authored Feb 17, 2006
364
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
365 /*
366
367 =item C<void set_string_keyed_int(INTVAL key, STRING *value)>
368
369 Sets the Parrot string value of the element at index C<key> to C<value>.
370
371 =cut
372
373 */
374
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
375 VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
376 FLOATVAL tempNum;
083213a @Whiteknight start rename of pmc_new to Parrot_pmc_new
Whiteknight authored Feb 16, 2010
377 PMC * const tempPMC = Parrot_pmc_new(INTERP, enum_class_Float);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
378
379 VTABLE_set_string_native(INTERP, tempPMC, value);
380 tempNum = VTABLE_get_number(INTERP, tempPMC);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
381 SELF.set_number_keyed_int(key, tempNum);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
382 }
383
384 /*
385
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored Aug 9, 2007
386 =item C<void set_string_keyed(PMC *key, STRING *value)>
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
387
388 Sets the string value of the element at index C<key> to
389 C<value>.
390
391 =cut
392
393 */
394
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
395 VTABLE void set_string_keyed(PMC *key, STRING *value) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
396 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
397 SELF.set_string_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
398 }
399
400 /*
401
402 =item C<void set_pmc_keyed_int(INTVAL key, PMC *src)>
403
404 Sets the PMC value of the element at index C<key> to C<*src>.
405
406 =cut
407
408 */
409
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
410 VTABLE void set_pmc_keyed_int(INTVAL key, PMC *src) {
a35f6fd @petdance consting & localizing
petdance authored Feb 9, 2008
411 const FLOATVAL tempNum = VTABLE_get_number(INTERP, src);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
412 SELF.set_number_keyed_int(key, tempNum);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
413 }
414
415 /*
416
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored Aug 9, 2007
417 =item C<void set_pmc_keyed(PMC *key, PMC *value)>
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
418
419 Sets the string value of the element at index C<key> to
420 C<value>.
421
422 =cut
423
424 */
425
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
426 VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
757f3a8 @chromatic [PMC] Replaced all uses of key_integer() outside of Key PMC and src/k…
chromatic authored May 8, 2009
427 const INTVAL k = VTABLE_get_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored Mar 11, 2008
428 SELF.set_pmc_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
429 }
430
431 }
432
433 /*
434
435 =back
436
437 =head1 SEE ALSO
438
1e8a4ab this patch adds some relevant 'push' ops to the resizable PMCs, descr…
Dan Sugalski authored Oct 19, 2004
439 F<docs/pdds/pdd17_basic_types.pod>.
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
440
441 =cut
442
443 */
444
445 /*
446 * Local variables:
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored Oct 9, 2006
447 * c-file-style: "parrot"
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored Jun 12, 2004
448 * End:
449 * vim: expandtab shiftwidth=4:
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored Oct 9, 2006
450 */
Something went wrong with that request. Please try again.