Skip to content

Commit

Permalink
fix: warnings deprecated (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh committed Sep 8, 2023
1 parent 17e42a5 commit 111f459
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/analysis-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
types: [opened, synchronize, reopened]
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'vcpkg.json'
push:
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'vcpkg.json'
push:
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'vcpkg.json'
push:
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-windows-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'vcpkg.json'
- 'vcproj/**'
push:
paths:
- 'src/**'
- 'source/**'
- 'cmake/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'vcpkg.json'
- 'vcproj/**'
branches:
- main

Expand Down
14 changes: 7 additions & 7 deletions source/common_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ MapPropertiesWindow::MapPropertiesWindow(wxWindow* parent, MapTab* view, Editor&
spawn_filename_ctrl =
newd wxTextCtrl(this, wxID_ANY, wxstr(map.getSpawnFilename())), 1, wxEXPAND
);

grid_sizer->Add(
newd wxStaticText(this, wxID_ANY, "External npc file")
);
Expand Down Expand Up @@ -626,24 +626,24 @@ void ExportMiniMapWindow::OnClickOK(wxCommandEvent& WXUNUSED(event))
for(int floor = 0; floor < MAP_LAYERS; ++floor) {
g_gui.SetLoadScale(int(floor*(100.f/16.f)), int((floor+1)*(100.f/16.f)));
FileName file(file_name_text_field->GetValue() + "_" + i2ws(floor) + ".bmp");
file.Normalize(wxPATH_NORM_ALL, directory.GetFullPath());
editor.exportMiniMap(file, floor, true);
file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_TILDE | wxPATH_NORM_DOTS, directory.GetFullPath());
editor.exportMiniMap(file, floor, true);
}
break;
}

case 1: { // Ground floor
FileName file(file_name_text_field->GetValue() + "_" + i2ws(GROUND_LAYER) + ".bmp");
file.Normalize(wxPATH_NORM_ALL, directory.GetFullPath());
editor.exportMiniMap(file, GROUND_LAYER, true);
file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_TILDE | wxPATH_NORM_DOTS, directory.GetFullPath());
editor.exportMiniMap(file, GROUND_LAYER, true);
break;
}

case 2: { // Specific floors
int floor = floor_number->GetValue();
FileName file(file_name_text_field->GetValue() + "_" + i2ws(floor) + ".bmp");
file.Normalize(wxPATH_NORM_ALL, directory.GetFullPath());
editor.exportMiniMap(file, floor, true);
file.Normalize(wxPATH_NORM_ABSOLUTE | wxPATH_NORM_TILDE | wxPATH_NORM_DOTS, directory.GetFullPath());
editor.exportMiniMap(file, floor, true);
break;
}

Expand Down
26 changes: 15 additions & 11 deletions source/filehandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,21 @@ bool DiskNodeFileReadHandle::renewCache()

BinaryNode* DiskNodeFileReadHandle::getRootNode()
{
assert(root_node == nullptr); // You should never do this twice
uint8_t first;
fread(&first, 1, 1, file);
if(first == NODE_START) {
root_node = getNode(nullptr);
root_node->load();
return root_node;
} else {
error_code = FILE_SYNTAX_ERROR;
return nullptr;
}
assert(root_node == nullptr); // You should never do this twice
uint8_t first;
size_t numRead = fread(&first, 1, 1, file);
if(numRead != 1) {
error_code = FILE_READ_ERROR;
return nullptr;
}
if(first == NODE_START) {
root_node = getNode(nullptr);
root_node->load();
return root_node;
} else {
error_code = FILE_SYNTAX_ERROR;
return nullptr;
}
}

//=============================================================================
Expand Down

0 comments on commit 111f459

Please sign in to comment.