Mikuro
Crotchety UI Nitpicker
Okay, I already posted this TWICE, but it keeps getting deleted from DB errors.
First, I'll run down of my original post, and then I have two more questions.
I couldn't figure out how to initialize a vU1024 (1024-bit unsigned integer from the Accelerate framework). I couldn't use any simple = operator to assign it a value.
Someone (I think it was Viro; thanks!) said that I need to assign values to each of the 32 integer elements individually, like so:
And that seems to work. Great! But boy, is it a hassle. Now for question #1:
I sometimes use this form to assign values to structs, like NSRects:
NSRect r = (NSRect){ {0,0} , {0,0} };
Since the 's' property of vU1024 is a struct, I feel like I ought to be able to do something similar, but I'm not quite sure how. This...
booga.s = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
...results in a "parse error before '{' token", I guess because I have no typecast. But how should I typecast it? I can't typecast it as vU1024, because I'm not assigning the entire object, just its 's' sub-struct.
Now, for question #2:
The vU1024 type is comprised of more than just this struct. It has an 8-element array of vUInt32's, and also a struct called 'vs' which has, again, 8 vUInt32's. So...what do these do? Should I be assigning them values as well?

I couldn't figure out how to initialize a vU1024 (1024-bit unsigned integer from the Accelerate framework). I couldn't use any simple = operator to assign it a value.
Someone (I think it was Viro; thanks!) said that I need to assign values to each of the 32 integer elements individually, like so:
Code:
vU1024 booga;
booga.s.MSW = 0; //MSW = Most Significant Word
booga.s.d2 = 0;
//...step through d3~d30
booga.s.d31 = 0;
booga.s.LSW = 0; //Least Significant Word
//then use the arithmetic functions described in vBigNum.h
I sometimes use this form to assign values to structs, like NSRects:
NSRect r = (NSRect){ {0,0} , {0,0} };
Since the 's' property of vU1024 is a struct, I feel like I ought to be able to do something similar, but I'm not quite sure how. This...
booga.s = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
...results in a "parse error before '{' token", I guess because I have no typecast. But how should I typecast it? I can't typecast it as vU1024, because I'm not assigning the entire object, just its 's' sub-struct.
Now, for question #2:
The vU1024 type is comprised of more than just this struct. It has an 8-element array of vUInt32's, and also a struct called 'vs' which has, again, 8 vUInt32's. So...what do these do? Should I be assigning them values as well?