Removed additional debug info.

This commit is contained in:
Ward Fisher 2015-05-07 20:22:34 -06:00 committed by Ward Fisher
parent 0d8be16398
commit 2574f11dbd

View File

@ -201,155 +201,76 @@ dapcvtattrval(nc_type etype, void* dst, NClist* src)
unsigned int memsize = nctypesizeof(etype);
unsigned int nvalues = nclistlength(src);
char* dstmem = (char*)dst;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
for(i=0;i<nvalues;i++) {
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
char* s = (char*)nclistget(src,i);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = 0;
switch (etype) {
case NC_BYTE: {
char tmp[128];
unsigned char* p = (unsigned char*)dstmem;
ok = sscanf(s,"%hhu",p);
#ifdef _MSC_VER
ok = sscanf(s,"%hC",p);
_ASSERTE(_CrtCheckMemory());
#else
ok = sscanf(s,"%hhu",p);
#endif
} break;
case NC_CHAR: {
signed char* p = (signed char*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%c",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_SHORT: {
short* p = (short*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%hd",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_INT: {
int* p = (int*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%d",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_FLOAT: {
float* p = (float*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%g",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_DOUBLE: {
double* p = (double*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%lg",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_UBYTE: {
unsigned char* p = (unsigned char*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%hhu",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_USHORT: {
unsigned short* p = (unsigned short*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%hu",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_UINT: {
unsigned int* p = (unsigned int*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%u",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_INT64: {
long long* p = (long long*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%lld",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_UINT64: {
unsigned long long* p = (unsigned long long*)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = sscanf(s,"%llu",p);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
} break;
case NC_STRING: case NC_URL: {
char** p = (char**)dstmem;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
*p = nulldup(s);
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
ok = 1;
} break;
default:
PANIC1("unexpected nc_type: %d",(int)etype);
}
if(ok != 1) {ncstat = NC_EINVAL; goto done;}
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
dstmem += memsize;
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
}
done:
#ifdef _MSC_VER
_ASSERTE(_CrtCheckMemory());
#endif
return THROW(ncstat);
}