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