Compilation fix OSX

Pedantic warning CLang for 64bits compiler.
This commit is contained in:
Bruno Herbelin
2023-08-12 16:01:12 +02:00
parent 793008852a
commit 3cde191afb
7 changed files with 16 additions and 12 deletions

View File

@@ -49,10 +49,10 @@ unsigned long IpEndpointName::GetHostByName( const char *s )
void IpEndpointName::AddressAsString( char *s ) const void IpEndpointName::AddressAsString( char *s ) const
{ {
if( address == ANY_ADDRESS ){ if( address == ANY_ADDRESS ){
std::sprintf( s, "<any>" ); std::snprintf( s, IpEndpointName::ADDRESS_STRING_LENGTH, "<any>" );
}else{ }else{
std::sprintf( s, "%d.%d.%d.%d", std::snprintf( s, IpEndpointName::ADDRESS_STRING_LENGTH, "%d.%d.%d.%d",
(int)((address >> 24) & 0xFF), (int)((address >> 24) & 0xFF),
(int)((address >> 16) & 0xFF), (int)((address >> 16) & 0xFF),
(int)((address >> 8) & 0xFF), (int)((address >> 8) & 0xFF),
@@ -65,9 +65,9 @@ void IpEndpointName::AddressAndPortAsString( char *s ) const
{ {
if( port == ANY_PORT ){ if( port == ANY_PORT ){
if( address == ANY_ADDRESS ){ if( address == ANY_ADDRESS ){
std::sprintf( s, "<any>:<any>" ); std::snprintf( s, IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH, "<any>:<any>" );
}else{ }else{
std::sprintf( s, "%d.%d.%d.%d:<any>", std::snprintf( s, IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:<any>",
(int)((address >> 24) & 0xFF), (int)((address >> 24) & 0xFF),
(int)((address >> 16) & 0xFF), (int)((address >> 16) & 0xFF),
(int)((address >> 8) & 0xFF), (int)((address >> 8) & 0xFF),
@@ -75,9 +75,9 @@ void IpEndpointName::AddressAndPortAsString( char *s ) const
} }
}else{ }else{
if( address == ANY_ADDRESS ){ if( address == ANY_ADDRESS ){
std::sprintf( s, "<any>:%d", port ); std::snprintf( s, IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH, "<any>:%d", port );
}else{ }else{
std::sprintf( s, "%d.%d.%d.%d:%d", std::snprintf( s, IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:%d",
(int)((address >> 24) & 0xFF), (int)((address >> 24) & 0xFF),
(int)((address >> 16) & 0xFF), (int)((address >> 16) & 0xFF),
(int)((address >> 8) & 0xFF), (int)((address >> 8) & 0xFF),

View File

@@ -1275,7 +1275,12 @@ void Control::keyboardCalback(GLFWwindow* w, int key, int, int action, int mods)
} }
Control::manager().input_access_.unlock(); Control::manager().input_access_.unlock();
} }
#if defined(APPLE)
else if ( w != Rendering::manager().mainWindow().window() &&
key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_SUPER )
#else
else if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL ) else if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
#endif
{ {
Rendering::manager().window(w)->toggleFullscreen(); Rendering::manager().window(w)->toggleFullscreen();
} }

View File

@@ -1023,7 +1023,7 @@ void ImGuiToolkit::RenderTimelineBPM (ImVec2 min_bbox, ImVec2 max_bbox, double t
{ {
// beat count label // beat count label
guint64 ticklabel = tick / time_beat; guint64 ticklabel = tick / time_beat;
ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%ld", ticklabel); ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%lu", (unsigned long) ticklabel);
ImVec2 label_size = ImGui::CalcTextSize(text_buf, NULL); ImVec2 label_size = ImGui::CalcTextSize(text_buf, NULL);
ImVec2 mini = ImVec2( pos.x - label_size.x / 2.f, pos.y); ImVec2 mini = ImVec2( pos.x - label_size.x / 2.f, pos.y);
ImVec2 maxi = ImVec2( pos.x + label_size.x / 2.f, pos.y); ImVec2 maxi = ImVec2( pos.x + label_size.x / 2.f, pos.y);

View File

@@ -20,7 +20,6 @@
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/matrix_access.hpp> #include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/string_cast.hpp>
#include <glm/gtx/vector_angle.hpp> #include <glm/gtx/vector_angle.hpp>
#include "Decorations.h" #include "Decorations.h"

View File

@@ -29,7 +29,6 @@
#include <glm/gtc/type_ptr.hpp> #include <glm/gtc/type_ptr.hpp>
#define GLM_ENABLE_EXPERIMENTAL #define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/string_cast.hpp>
#include "Resource.h" #include "Resource.h"
#include "Log.h" #include "Log.h"

View File

@@ -299,7 +299,7 @@ void TimerMetronomeWindow::Render()
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_BOLD); ImGuiToolkit::PushFont(ImGuiToolkit::FONT_BOLD);
guint64 lap = (time_-start_time_hand_)/duration_hand_; guint64 lap = (time_-start_time_hand_)/duration_hand_;
snprintf(text_buf, 24, "%ld turn%s", lap, lap > 1 ? "s" : " " ); snprintf(text_buf, 24, "%lu turn%s", (unsigned long) lap, lap > 1 ? "s" : " " );
label_size = ImGui::CalcTextSize(text_buf, NULL); label_size = ImGui::CalcTextSize(text_buf, NULL);
ImGui::SetCursorScreenPos(circle_center + ImVec2(0.f, circle_radius * -0.7f) - label_size/2); ImGui::SetCursorScreenPos(circle_center + ImVec2(0.f, circle_radius * -0.7f) - label_size/2);
ImGui::Text("%s", text_buf); ImGui::Text("%s", text_buf);

View File

@@ -22,6 +22,7 @@
#define WINDOW_TOOLBOX_DIST_TO_BORDER 10.f #define WINDOW_TOOLBOX_DIST_TO_BORDER 10.f
#include <iostream> #include <iostream>
#include <sstream>
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
@@ -3545,7 +3546,7 @@ void Navigator::RenderNewPannel()
ImGui::Text("Codec :");ImGui::SameLine(150); ImGui::Text("Codec :");ImGui::SameLine(150);
ImGui::Text("%s", VideoRecorder::profile_name[ _video_recorder.profile() ] ); ImGui::Text("%s", VideoRecorder::profile_name[ _video_recorder.profile() ] );
ImGui::Text("Frames :");ImGui::SameLine(150); ImGui::Text("Frames :");ImGui::SameLine(150);
ImGui::Text("%ld / %ld", _video_recorder.numFrames(), _video_recorder.files().size() ); ImGui::Text("%lu / %lu", (unsigned long)_video_recorder.numFrames(), _video_recorder.files().size() );
ImGui::Spacing(); ImGui::Spacing();
ImGui::ProgressBar(_video_recorder.progress()); ImGui::ProgressBar(_video_recorder.progress());