ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/OpenCL.xs
(Generate patch)

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.27 by root, Thu Apr 19 13:18:31 2012 UTC vs.
Revision 1.28 by root, Thu Apr 19 13:49:33 2012 UTC

144 return 0; 144 return 0;
145 145
146 if (SvROK (sv) && SvTYPE (SvRV (sv)) == SVt_PVAV) 146 if (SvROK (sv) && SvTYPE (SvRV (sv)) == SVt_PVAV)
147 { 147 {
148 AV *av = (AV *)SvRV (sv); 148 AV *av = (AV *)SvRV (sv);
149 int i, len = av_len (av); 149 int i, len = av_len (av) + 1;
150 cl_context_properties *p = tmpbuf (sizeof (cl_context_properties) * (len + extracount + 1)); 150 cl_context_properties *p = tmpbuf (sizeof (cl_context_properties) * (len + extracount + 1));
151 cl_context_properties *l = p; 151 cl_context_properties *l = p;
152 152
153 if (len & 1) 153 if (len & 1)
154 croak ("%s: %s is not a property list (must be even number of elements)", func, svname); 154 croak ("%s: %s is not a property list (must be even number of elements)", func, svname);
155 155
156 while (extracount--) 156 while (extracount--)
157 *l++ = *extra++; 157 *l++ = *extra++;
158 158
159 for (i = 0; i < len; i += 2) 159 for (i = 0; i < len; ++i)
160 { 160 {
161 cl_context_properties t = SvIV (*av_fetch (av, i, 0)); 161 cl_context_properties t = SvIV (*av_fetch (av, i, 0));
162 cl_context_properties v; 162 cl_context_properties v;
163
164 ++i;
163 165
164 switch (t) 166 switch (t)
165 { 167 {
166 default: 168 default:
167 /* unknown property, treat as int */ 169 /* unknown property, treat as int */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines