[Question]Dudb and ret_memcpy - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question]Dudb and ret_memcpy (
/showthread.php?tid=335393)
[Question]Dudb and ret_memcpy -
jujuv - 18.04.2012
Hello there,
I use the dudb library by dracoblue and i have a warning saying "symbol ret_memcpy" isn't used";
i know i can simply add the preprocessor directive "#pragma unused ret_memcpy" but ui'm curious and i would like to know why we get this warning everytime we use this include ?
What is this "symbol wich is never used ? (i guess it's a consstant).
Anyway, sorry for my bad english ^^
Re : [Question]Dudb and ret_memcpy -
jujuv - 18.04.2012
pawn Код:
ret_memcpy(source[],index=0,numbytes) {
new tmp[MAX_STRING];
new i=0;
tmp[0]=0;
if (index>=strlen(source)) return tmp;
if (numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
if (numbytes<=0) return tmp;
for (i=index;i<numbytes+index;i++) {
tmp[i-index]=source[i];
if (source[i]==0) return tmp;
}
tmp[numbytes]=0;
return tmp;
}
It's a function in the dutils library but this func' is called 3 time in this library so why the pawn compiler say "unused" ?
Re: [Question]Dudb and ret_memcpy -
InfinityGamerX - 18.04.2012
pawn Код:
ret_memcpy(source[],index=0,numbytes) {
new tmp[MAX_STRING];
new i=0;
tmp[0]=0;
if (index>=strlen(source)) return tmp;
if (numbytes+index>=strlen(source)) numbytes=strlen(source)-index;
if (numbytes<=0) return tmp;
for (i=index;i<numbytes+index;i++) {
tmp[i-index]=source[i];
if (source[i]==0) return tmp;
}
tmp[numbytes]=0;
return tmp;
}
See Its Here
Re : [Question]Dudb and ret_memcpy -
jujuv - 18.04.2012
Yea but why the hell does it say "unused" thought this function is used ?
Re: [Question]Dudb and ret_memcpy -
InfinityGamerX - 18.04.2012
thats beacause you still didnt use the funtion
on CMD:new(playerid,params[])
we use #pragma unused params
to avoid the warning from that params