Můžete mi poradit proč
[CODE]arguments[n][c][0]=pPrevious-1-previousLength;[/CODE] vrací hlášku:
assignment makes integer from pointer without a cast [enabled by default]|
Chci upravit pozici ukazatele char *.
[CODE]
bool parseKernelArgs(char * path, FILES * files, SETTINGS * settings){
if (path != NULL){
// settings->argumentsCount;
}
else // READING kernel args from config
{
int n=0;
char*pCopy;char*pPrevious;char*pWord;
size_t size, previousLength;
int c, count;
for (; n<settings->argumentsCount; n++ )
{
pCopy = settings->arguments[n]; // just copy pointer
pWord = pCopy;
pPrevious = pCopy;
c = 0;
while(pCopy && *pCopy) {
pCopy = strchr(pCopy, settings->separator);
if (pCopy) pCopy++;
c++;
} ;
count = c;
pCopy=pPrevious;
arguments[n]=malloc(count*sizeof (char**));
previousLength=0;
for(c=0; c<count;c++) {
/* [0] - begin of param name
[1] - end of param name
[2] - begin of value
[3] - end of value
*/
arguments[n][c]=malloc(4*sizeof (char*));
pCopy = strchr(pCopy, settings->separator);
size= pCopy-pPrevious;
pWord = memchr(pPrevious, '=', size);
pPrevious=pWord;
previousLength=size;
if (pWord!=NULL)
{
arguments[n][c][0]=pPrevious-1-previousLength;
arguments[n][c][1]=pWord-1;
arguments[n][c][2]=pWord+1;
arguments[n][c][3]=pCopy-1;
}
else
{
arguments[n][c][0]=NULL;
arguments[n][c][1]=NULL;
arguments[n][c][3]=pCopy-1-previousLength;
arguments[n][c][3]=pCopy-1;
}
} ;
}
}
}
[/CODE]