MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetBasicVariableInfo

Function GetBasicVariableInfo

SuperCalc.cpp:969–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967std::vector<char*> externalBlocks;
968
969const char* GetBasicVariableInfo(const ExternTypeInfo& type, char* ptr)
970{
971 static char val[256];
972
973 switch(type.type)
974 {
975 case ExternTypeInfo::TYPE_CHAR:
976 if(codeSymbols[type.offsetToName] == 'b')
977 {
978 safeprintf(val, 256, *(unsigned char*)ptr ? "true" : "false");
979 }else{
980 if(*(unsigned char*)ptr)
981 safeprintf(val, 256, "'%c' (%d)", *(unsigned char*)ptr, (int)*(unsigned char*)ptr);
982 else
983 safeprintf(val, 256, "0");
984 }
985 break;
986 case ExternTypeInfo::TYPE_SHORT:
987 safeprintf(val, 256, "%d", *(short*)ptr);
988 break;
989 case ExternTypeInfo::TYPE_INT:
990 safeprintf(val, 256, type.subType == 0 ? "%d" : "0x%x", *(int*)ptr);
991 break;
992 case ExternTypeInfo::TYPE_LONG:
993 safeprintf(val, 256, "%lld", *(long long*)ptr);
994 break;
995 case ExternTypeInfo::TYPE_FLOAT:
996 safeprintf(val, 256, "%f", *(float*)ptr);
997 break;
998 case ExternTypeInfo::TYPE_DOUBLE:
999 safeprintf(val, 256, "%f", *(double*)ptr);
1000 break;
1001 default:
1002 safeprintf(val, 256, "not basic type");
1003 }
1004 return val;
1005}
1006
1007void FillArrayVariableInfo(const ExternTypeInfo& type, char* ptr, HTREEITEM parent, bool update)
1008{

Callers 6

FillArrayVariableInfoFunction · 0.85
FillComplexVariableInfoFunction · 0.85
FillFunctionPointerInfoFunction · 0.85
FillVariableInfoTreeFunction · 0.85
UpdateWatchedVariablesFunction · 0.85
WndProcFunction · 0.85

Calls 1

safeprintfFunction · 0.85

Tested by

no test coverage detected