Skip to content

HTTPS clone URL

Subversion checkout URL

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