>>51
when you put a variable after the star, the star returns the address of the variable.
Name:
Anonymous2007-09-13 0:49 ID:SdzwQKNt
+x is positive x, -y is negative y, *x is multiple x.
Name:
Anonymous2007-09-13 0:49 ID:RN5OLYB3
>>49
I actually do it like this:
void qwerty (int *x, int *y, int size) {
while(size--) *x++ = *y++;
if some_bullshit {
do_some_bullshit(); }}
Kein Problem.
MEMCPY WILL NOT WORK DUE TO ENDIANESS ISSUES YOU FUCKING FUCKTARDS
ALSO >>44 sizeof(int) IS NEVER 1. NEVER. >>59
NO IT CANNOT
THANKYOU. BYE
FUCKWIDS
Name:
Anonymous2007-09-13 11:54 ID:Kfyw6JKG
ITT OMG OPTIMIZED
Name:
Anonymous2007-09-13 14:23 ID:381I8pvJ
void qwerty(int *x, int *y, size_t s){
size_t t, l = sizeof(uint64_t)/sizeof(int), size_t m = l - 1;
if((y | x) & m){
if((y ^ x) & m || s < l)
t = s;
else
t = l - (y & m);
s -= t;
do{
*x++ = *y++;
}while(--t);
t = s / l;
if(t)
do{
*(uint64_t*)x = *(uint64_t*)y; x += l; y += l;
}while(--t);
t = s & m;
if(t)
do{
*x++ = *y++;
}while(--t);
}
>>63
oops... void qwerty(int *x, int *y, size_t s){
size_t t, l = sizeof(uint64_t)/sizeof(int), m = l - 1;
if((y | x) & m){
if((y ^ x) & m || s < l)
t = s;
else
t = l - (y & m);
s -= t;
do{
*x++ = *y++;
}while(--t);
t = s / l;
if(t)
do{
*(uint64_t*)x = *(uint64_t*)y; x += l; y += l;
}while(--t);
t = s & m;
if(t)
do{
*x++ = *y++;
}while(--t);
}
Name:
Anonymous2007-09-13 16:12 ID:/Rn6s4wx
>>62
I expect full, frank and amusing details by tomorrow, however, and I'll happily return the favour.
1:
Endianness problems only occur when you switch between different types of endianness. So unless your endianness changes based on the memory address, memcpy works just fine.
2:
In the C and C++ standards the following things are required:
sizeof(char) = 1
sizeof(char) ≤ sizeof(short) ≤ sizeof(int) ≤ sizeof(long)
char ≥ 8 bits, short ≥ 16 bits, int ≥ 16 bits, long ≥ 32 bits