Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 483 lines (301 sloc) 9.27 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 $Id$
4
5 =head1 NAME
6
f474cd7 @bschmalhofer [perl #38235] Rename (dyn)?classes to (dyn)?pmc
bschmalhofer authored
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
8
9 =head1 DESCRIPTION
10
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
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
13
14 =head2 Functions
15
16 =over 4
17
18 =cut
19
20 */
21
22 #include "parrot/parrot.h"
23
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
24 pmclass FixedFloatArray need_ext provides array {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
25 ATTR INTVAL size;
26 ATTR FLOATVAL *float_array;
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
27
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
28 /*
29
30 =back
31
32 =head2 Methods
33
34 =over 4
35
36 =item C<void init()>
37
38 Initializes the array.
39
40 =cut
41
42 */
43
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
44 VTABLE void init() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
45 Parrot_FixedFloatArray_attributes* attrs =
46 mem_allocate_zeroed_typed(Parrot_FixedFloatArray_attributes);
47 PMC_data(SELF) = attrs;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
48 }
49
50 /*
51
52 =item C<void destroy()>
53
54 Destroys the array.
55
56 =cut
57
58 */
59
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
60 VTABLE void destroy() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
61 FLOATVAL *float_array;
62 GET_ATTR_float_array(INTERP, SELF, float_array);
63 if (float_array)
64 mem_sys_free(float_array);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
65
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
66 mem_sys_free(PMC_data(SELF));
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
67 }
68
69 /*
70
71 =item C<PMC *clone()>
72
73 Creates and returns a copy of the array.
74
75 =cut
76
77 */
78
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
79 VTABLE PMC *clone() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
80 INTVAL size;
81 FLOATVAL *self_float_array, *dest_float_array;
cc7c3b2 @pmichaud [core]:
pmichaud authored
82 size_t mem_size;
a35f6fd @petdance consting & localizing
petdance authored
83 PMC * const dest = 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);
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
85
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
86 if (!self_float_array)
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
87 return dest;
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
88
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
89 GET_ATTR_size(INTERP, SELF, size);
90 SET_ATTR_size(INTERP, dest, size);
cc7c3b2 @pmichaud [core]:
pmichaud authored
91 mem_size = size * sizeof (FLOATVAL);
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
92
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
93 dest_float_array = (FLOATVAL*)mem_sys_allocate(mem_size);
94 mem_sys_memcopy(dest_float_array, self_float_array, mem_size);
95 SET_ATTR_float_array(INTERP, dest, dest_float_array);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
96 PObj_active_destroy_SET(dest);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
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() {
112 STRING *name = CONST_STRING(interp, "set_key");
113 PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
114 PMC * const key = pmc_new(INTERP, enum_class_Key);
115
116 Parrot_PCCINVOKE(interp, iter, name, "P->", key);
117 PObj_get_FLAGS(key) |= KEY_integer_FLAG;
118
119 if (SELF.get_integer() == 0)
120 VTABLE_set_integer_native(INTERP, key, -1);
121 else
122 VTABLE_set_integer_native(INTERP, key, 0);
123
124 return iter;
125 }
126
127 /*
128
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
129 =item C<INTVAL get_bool()>
130
131 Returns whether the array has any elements (meaning been initialized, for a
132 fixed sized array).
133
134 =cut
135
136 */
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
137 VTABLE INTVAL get_bool() {
a35f6fd @petdance consting & localizing
petdance authored
138 const INTVAL size = SELF.elements();
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
139 return (INTVAL)(size != 0);
140 }
141
142 /*
143
144 =item C<INTVAL elements()>
145
146 =cut
147
148 */
149
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
150 VTABLE INTVAL elements() {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
151 INTVAL size;
152 GET_ATTR_size(INTERP, SELF, size);
153 return size;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
154 }
155
156 /*
157
158 =item C<INTVAL get_integer()>
159
160 Returns the number of elements in the array.
161
162 =cut
163
164 */
165
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
166 VTABLE INTVAL get_integer() {
ae8baa5 @bschmalhofer DYNDYNSELF in the Fixed*Array PMC looks like a typo. Using SELF propably
bschmalhofer authored
167 return SELF.elements();
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
168 }
169
170
171 /*
172
173 =item C<INTVAL get_integer_keyed_int(INTVAL key)>
174
175 Returns the integer 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
181 VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
182 const FLOATVAL f = SELF.get_number_keyed_int(key);
8275ff5 @chromatic [PMC] Fixed a couple of casting warnings of function return values.
chromatic authored
183 return (INTVAL)f;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
184 }
185
186 /*
187
188 =item C<INTVAL get_integer_keyed(PMC *key)>
189
190 Returns the integer value of the element at index C<*key>.
191
192 =cut
193
194 */
195
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
196 VTABLE INTVAL get_integer_keyed(PMC *key) {
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
197 /* simple int keys only */
a35f6fd @petdance consting & localizing
petdance authored
198 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
199 return SELF.get_integer_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
200 }
201
202
203 /*
204
205 =item C<FLOATVAL get_number_keyed_int(INTVAL key)>
206
207 Returns the floating-point value of the element at index C<key>.
208
209 =cut
210
211 */
212
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
213 VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
214 FLOATVAL *float_array;
215 INTVAL size;
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
216
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
217 GET_ATTR_size(INTERP, SELF, size);
218 if (key < 0 || key >= size)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored
219 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
d185452 @chromatic Standardize internal exception calls (James deBoer, james at huronbox do...
chromatic authored
220 "FixedFloatArray: index out of bounds!");
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
221
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
222 GET_ATTR_float_array(INTERP, SELF, float_array);
223 return float_array[key];
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
224 }
225
226 /*
227
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored
228 =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
229
230 Returns the floating-point value of the element at index C<*key>.
231
232 =cut
233
234 */
235
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
236 VTABLE FLOATVAL get_number_keyed(PMC *key) {
a35f6fd @petdance consting & localizing
petdance authored
237 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
238 return SELF.get_number_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
239 }
240
241 /*
242
243 =item C<STRING *get_string_keyed_int(INTVAL key)>
244
245 Returns the Parrot string value of the element at index C<key>.
246
247 =cut
248
249 */
250
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
251 VTABLE STRING *get_string_keyed_int(INTVAL key) {
252 PMC * const e = SELF.get_pmc_keyed_int(key);
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
253 return VTABLE_get_string(INTERP, e);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
254 }
255
256 /*
257
258 =item C<STRING *get_string_keyed(PMC *key)>
259
260 Returns the Parrot string value of the element at index C<*key>.
261
262 =cut
263
264 */
265
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
266 VTABLE STRING *get_string_keyed(PMC *key) {
a35f6fd @petdance consting & localizing
petdance authored
267 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
268 return SELF.get_string_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
269 }
270
271
272 /*
273
274 =item C<PMC *get_pmc_keyed_int(INTVAL key)>
275
276 Returns the PMC value of the element at index C<key>.
277
278 =cut
279
280 */
281
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
282 VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
283 PMC * const ret = pmc_new(INTERP, enum_class_Float);
284 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
285
286 VTABLE_set_number_native(INTERP, ret, val);
287 return ret;
288 }
289
290 /*
291
292 =item C<PMC *get_pmc_keyed(PMC *key)>
293
294 Returns the PMC value of the element at index C<*key>.
295
296 =cut
297
298 */
299
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
300 VTABLE PMC *get_pmc_keyed(PMC *key) {
a35f6fd @petdance consting & localizing
petdance authored
301 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
302 return SELF.get_pmc_keyed_int(k);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
303 }
304
305 /*
306
307 =item C<void set_integer_native(INTVAL size)>
308
309 Resizes the array to C<size> elements.
310
311 =cut
312
313 */
314
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
315 VTABLE void set_integer_native(INTVAL new_size) {
316 INTVAL old_size;
317 GET_ATTR_size(INTERP, SELF, old_size);
318 if (old_size || new_size < 1)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored
319 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
320 "FixedFloatArray: Can't resize!");
f6d5c3e @chromatic [PMC] More minor cleanups and reformattings.
chromatic authored
321
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
322 SET_ATTR_size(INTERP, SELF, new_size);
1bc2b58 @bschmalhofer [codingstd] trailing_space.t
bschmalhofer authored
323 SET_ATTR_float_array(INTERP, SELF,
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
324 mem_allocate_n_typed(new_size, FLOATVAL));
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
325 PObj_active_destroy_SET(SELF);
326 }
327
328 /*
329
330 =item C<void set_integer_keyed_int(INTVAL key, INTVAL value)>
331
332 Sets the integer value of the element at index C<key> to C<value>.
333
334 =cut
335
336 */
337
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
338 VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
339 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
340 }
341
342 /*
343
344 =item C<void set_integer_keyed(PMC *key, INTVAL value)>
345
346 Sets the integer value of the element at index C<key> to C<value>.
347
348 =cut
349
350 */
351
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
352 VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
a35f6fd @petdance consting & localizing
petdance authored
353 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
354 SELF.set_integer_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
355 }
356
357 /*
358
359 =item C<void set_number_keyed_int(INTVAL key, FLOATVAL value)>
360
361 Sets the floating-point value of the element at index C<key> to
362 C<value>.
363
364 =cut
365
366 */
367
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
368 VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
369 FLOATVAL *float_array;
370 INTVAL size;
371
372 GET_ATTR_size(INTERP, SELF, size);
373 if (key < 0 || key >= size)
2255840 @allisonrandal [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allisonrandal authored
374 Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
d185452 @chromatic Standardize internal exception calls (James deBoer, james at huronbox do...
chromatic authored
375 "FixedFloatArray: index out of bounds!");
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
376
a638c12 @cotto [pmc] get rid of UnionVal in *FloatArray
cotto authored
377 GET_ATTR_float_array(INTERP, SELF, float_array);
378 float_array[key] = value;
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
379 }
380
381 /*
382
383 =item C<void set_number_keyed(PMC *key, FLOATVAL value)>
384
385 Sets the floating-point value of the element at index C<key> to
386 C<value>.
387
388 =cut
389
390 */
391
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
392 VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
a35f6fd @petdance consting & localizing
petdance authored
393 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
394 SELF.set_number_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
395 }
7298186 @particle pmc: convert Fixed*Array and Resizable*Array internal_exceptions to real...
particle authored
396
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
397 /*
398
399 =item C<void set_string_keyed_int(INTVAL key, STRING *value)>
400
401 Sets the Parrot string value of the element at index C<key> to C<value>.
402
403 =cut
404
405 */
406
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
407 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
408 FLOATVAL tempNum;
a35f6fd @petdance consting & localizing
petdance authored
409 PMC * const tempPMC = pmc_new(INTERP, enum_class_Float);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
410
411 VTABLE_set_string_native(INTERP, tempPMC, value);
412 tempNum = VTABLE_get_number(INTERP, tempPMC);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
413 SELF.set_number_keyed_int(key, tempNum);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
414 }
415
416 /*
417
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored
418 =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
419
420 Sets the string value of the element at index C<key> to
421 C<value>.
422
423 =cut
424
425 */
426
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
427 VTABLE void set_string_keyed(PMC *key, STRING *value) {
a35f6fd @petdance consting & localizing
petdance authored
428 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
429 SELF.set_string_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
430 }
431
432 /*
433
434 =item C<void set_pmc_keyed_int(INTVAL key, PMC *src)>
435
436 Sets the PMC value of the element at index C<key> to C<*src>.
437
438 =cut
439
440 */
441
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
442 VTABLE void set_pmc_keyed_int(INTVAL key, PMC *src) {
a35f6fd @petdance consting & localizing
petdance authored
443 const FLOATVAL tempNum = VTABLE_get_number(INTERP, src);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
444 SELF.set_number_keyed_int(key, tempNum);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
445 }
446
447 /*
448
95e3676 @Infinoid [pmc] PDD07-ize function signatures in src/pmc/[b-f]*.pmc
Infinoid authored
449 =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
450
451 Sets the string value of the element at index C<key> to
452 C<value>.
453
454 =cut
455
456 */
457
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
458 VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
a35f6fd @petdance consting & localizing
petdance authored
459 const INTVAL k = key_integer(INTERP, key);
59661f1 @allisonrandal [pdd17pmc] Merging the pdd17pmc branch into trunk (r24435 to r26307).
allisonrandal authored
460 SELF.set_pmc_keyed_int(k, value);
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
461 }
462
463 }
464
465 /*
466
467 =back
468
469 =head1 SEE ALSO
470
1e8a4ab this patch adds some relevant 'push' ops to the resizable PMCs, describe...
Dan Sugalski authored
471 F<docs/pdds/pdd17_basic_types.pod>.
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
472
473 =cut
474
475 */
476
477 /*
478 * Local variables:
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored
479 * c-file-style: "parrot"
4498fea This patch adds the above Fixed*Array classes. They are basic tests for
Dan Sugalski authored
480 * End:
481 * vim: expandtab shiftwidth=4:
72575ae @bschmalhofer #40481: [PATCH] C-code coda in pmc files
bschmalhofer authored
482 */
Something went wrong with that request. Please try again.