db_data.data = (char*)keyName;
db_data.data = NS_CONST_CAST(char*, keyName.get());
int writeDBM(int cycles){    printf("writeDBM\n");    DBT db_key, db_data ;    PRIntervalTime time = PR_IntervalNow();    while (cycles--) {                // create database file        myDB = dbopen(TMPDIR "foodb",                      O_RDWR | O_CREAT ,                      0600 ,                      DB_HASH ,                      &hash_info) ;                if (!myDB) {             printf("no db!\n");            return -1;        }                // initalize data to write        int x;        char * data = (char*) malloc(DATASIZE);        for (x=0; x<DATASIZE; x++)            *data = '\0';        for (x=1; x<=ENTRYCOUNT; x++) {            nsCAutoString keyName("foo");            keyName.AppendInt( x );                        db_key.data = (char*)keyName;            db_key.size = keyName.Length();                        db_data.data = data;            db_data.size = DATASIZE ;                        if(0 != (*myDB->put)(myDB, &db_key, &db_data, 0)) {                printf("--> Error putting\n");                return -1;            }#if USE_ENTRY_ID            db_key.data = (void*)&x;            db_key.size = sizeof(x);            db_data.data = (char*)keyName;            db_data.size = keyName.Length();                        if(0 != (*myDB->put)(myDB, &db_key, &db_data, 0)) {                printf("--> Error putting\n");                return -1;            }#endif        }                (*myDB->sync)(myDB, 0);         free(data);    }    return PR_IntervalToMilliseconds( PR_IntervalNow() - time);}