When trying to compile blurc-0.1b (from here http://blurc.sourceforge.net/)
I get this error:
Code:
chris@chris-desktop:~/blurc-0.1b$ make
g++ -O2 -c UuidHandler.cpp
UuidHandler.cpp: In static member function `static uint128_t*
UuidHandler::create_base_uuid()':
UuidHandler.cpp:64: error: cannot convert `uint128_t*' to `char*' in assignment
make: *** [UuidHandler.o] Error 1
The relevant bit of code (i think, dont know C++) is this:
Code:
uint128_t* UuidHandler::create_base_uuid()
{
char baseStr[128];
int delim = '-';
unsigned long dataLongValue;
char *delimPtr;
char *dataPtr;
char temp[10];
int toBeCopied;
char *data;
if (uuid_data == NULL) {
strcpy(baseStr, UUID);
uuid_data = (uint128_t *)malloc(sizeof(uint128_t));
data = uuid_data->data;
memset(data, '\0', sizeof(uint128_t));
memset(temp, '\0', 10);
dataPtr = baseStr;
delimPtr = NULL;
delimPtr = strchr(dataPtr, delim);
toBeCopied = delimPtr - dataPtr;
if (toBeCopied != 8) {
return NULL;
}
strncpy(temp, dataPtr, toBeCopied);
dataLongValue = htonl(strtoul(temp, NULL, 16));
memcpy(&data[0], &dataLongValue, 4);
/*
* Get the next 4 bytes (note that there is a "-"
* between them now)
*/
memset(temp, '\0', 10);
dataPtr = delimPtr + 1;
delimPtr = strchr(dataPtr, delim);
toBeCopied = delimPtr - dataPtr;
if (toBeCopied != 4) {
return NULL;
}
strncpy(temp, dataPtr, toBeCopied);
dataPtr = delimPtr + 1;
delimPtr = strchr(dataPtr, delim);
toBeCopied = delimPtr - dataPtr;
if (toBeCopied != 4) {
return NULL;
}
strncat(temp, dataPtr, toBeCopied);
dataLongValue = htonl(strtoul(temp, NULL, 16));
memcpy(&data[4], &dataLongValue, 4);
/*
* Get the last 4 bytes (note that there are 6 bytes
* after the last separator, which is truncated (2+4)
*/
memset(temp, '\0', 10);
dataPtr = delimPtr + 1;
dataPtr = delimPtr + 1;
delimPtr = strchr(dataPtr, delim);
toBeCopied = delimPtr - dataPtr;
if (toBeCopied != 4) {
return NULL;
}
strncpy(temp, dataPtr, toBeCopied);
strncat(temp, (delimPtr + 1), 4);
dataLongValue = htonl(strtoul(temp, NULL, 16));
memcpy(&data[8], &dataLongValue, 4);
dataLongValue = htonl(strtoul(delimPtr + 5, NULL, 16));
memcpy(&data[12], &dataLongValue, 4);
}
return uuid_data;
}
Some help wold really be appreciated as i would love to get this working.
Cheers, Chris
Bookmarks