fix warnings

This commit is contained in:
IlyaShurupov 2024-03-24 10:13:18 +03:00
parent 5d9e270aa9
commit 0fb9326c08
4 changed files with 39 additions and 46 deletions

View file

@ -113,9 +113,9 @@ void obj::ObjectsGUI::setClipboard(obj::Object* obj) {
obj::Object* obj::ObjectsGUI::getClipboard() { return mClipboard; }
obj::Object* imgui_object_create_menu(obj::TypeGroups* type_group = NULL) {
obj::Object* imgui_object_create_menu(obj::TypeGroups* type_group = nullptr) {
obj::Object* newo = NULL;
obj::Object* newo = nullptr;
if (!type_group) {
type_group = &obj::NDO->type_groups;
@ -346,9 +346,9 @@ obj::ObjectsGUI::ViewStackNode obj::ObjectsGUI::interpreterView(obj::Interpreter
auto operand = interp.mOperandsStack.mBuff[i];
tp::alni operand_val = (tp::alni) operand;
if (operand_val == NULL) {
Text("NULL");
} else if (tp::uint2(operand_val) == NULL) {
if (operand_val == 0) {
Text("nullptr");
} else if (tp::uint2(operand_val) == 0) {
Text("2 BYTE VAL : %i", tp::uint2(operand_val));
} else {
if (Selectable(operand->type->name, false, 0, ImVec2(100, 0))) {
@ -513,7 +513,7 @@ obj::ObjectsGUI::ViewStackNode obj::ObjectsGUI::linkoView(obj::LinkObject* obj)
setClipboard(obj->getLink());
}
if (ImGui::Selectable("Set Null")) {
obj->setLink(NULL);
obj->setLink(nullptr);
}
return {};
@ -907,7 +907,7 @@ void obj::ObjectsGUI::explorer() {
}
ImGui::PopID();
if (ImGui::BeginPopupContextItem(NULL, ImGuiPopupFlags_MouseButtonRight)) {
if (ImGui::BeginPopupContextItem(nullptr, ImGuiPopupFlags_MouseButtonRight)) {
obj::Object* curretn_object = childo->data->obj;
ImGui::Text("%s at %x", curretn_object->type->name, curretn_object);
@ -997,7 +997,7 @@ void obj::ObjectsGUI::explorer() {
ImGui::Text("Preview is Unavaliable");
}
if (new_active != NULL) {
if (new_active != 0) {
cd(new_active.obj, new_active.id);
}
}

View file

@ -29,7 +29,9 @@ void skip_param(ByteCode* bytecode) { bytecode->mInstructionIdx += 2; }
uint2 param(ByteCode* bytecode) { return loadConstDataIdx(bytecode); }
void Interpreter::exec(obj::MethodObject* method, obj::ClassObject* self, obj::DictObject* globals, InitialierList<GlobalDef> globals2) {
void Interpreter::exec(
obj::MethodObject* method, obj::ClassObject* self, obj::DictObject* globals, InitialierList<GlobalDef> globals2
) {
if (!method->mScript->mBytecode.mInstructions.size()) {
return;
}
@ -272,7 +274,7 @@ void Interpreter::stepBytecodeIn() {
// PUSH_ARGS protocol
uint2 len = 0;
mOperandsStack.push((Object*) len);
mOperandsStack.push((Object*) (alni) len);
mOperandsStack.push(nullptr);
// CALL protocol
@ -320,7 +322,7 @@ void Interpreter::stepBytecodeIn() {
// ...
uint2 len = read_byte(bytecode);
mOperandsStack.push((Object*) len);
mOperandsStack.push((Object*) (alni) len);
mOperandsStack.push(nullptr);
break;
}
@ -594,7 +596,9 @@ void Interpreter::stepBytecodeIn() {
}
}
void Interpreter::execAll(obj::MethodObject* method, obj::ClassObject* self, obj::DictObject* globals, InitialierList<GlobalDef> globals2) {
void Interpreter::execAll(
obj::MethodObject* method, obj::ClassObject* self, obj::DictObject* globals, InitialierList<GlobalDef> globals2
) {
if (!method->mScript->mBytecode.mInstructions.size()) {
return;
}