Skip to content

Instantly share code, notes, and snippets.

@naszar
Created August 16, 2014 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naszar/7ccf78f770e90d335011 to your computer and use it in GitHub Desktop.
Save naszar/7ccf78f770e90d335011 to your computer and use it in GitHub Desktop.
0001-buid-issue-partial-revert-97a8ca44-remove-outdated-f.patch
From c17d8ea09070c1e702c2d881d8a170304e831e8c Mon Sep 17 00:00:00 2001
From: naszar <naszar@ya.ru>
Date: Sun, 6 Jul 2014 18:47:20 +1100
Subject: [PATCH 1/2] buid issue: partial revert 97a8ca44, remove outdated
functions call and some cmake fixes
Signed-off-by: naszar <naszar@ya.ru>
---
CMakeLists.txt | 1 +
CMakeModules/FindIUP.cmake | 2 +-
src/backends/randr.c | 21 ++++++++++-----------
src/gui/iupgui.c | 2 +-
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0273685..3482051 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,6 +201,7 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type")
# Compiler flags
if(UNIX)
set(CMAKE_C_FLAGS "-Wall" CACHE STRING "C flags" FORCE)
+ link_libraries(m)
elseif(MSVC)
set(CMAKE_C_FLAGS_DEBUG "/W3 /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" CACHE STRING
"Debug flags" FORCE)
diff --git a/CMakeModules/FindIUP.cmake b/CMakeModules/FindIUP.cmake
index 1bfe742..5f8bdf1 100644
--- a/CMakeModules/FindIUP.cmake
+++ b/CMakeModules/FindIUP.cmake
@@ -6,7 +6,7 @@
# Define search directories depending on system
if(CMAKE_COMPILER_IS_GNUCC)
- set(_search_path_inc ENV CPATH)
+ set(_search_path_inc ENV CPATH /usr/include/iup)
set(_search_path_lib ENV LIBRARY_PATH)
endif(CMAKE_COMPILER_IS_GNUCC)
diff --git a/src/backends/randr.c b/src/backends/randr.c
index 49b4530..bf5124a 100644
--- a/src/backends/randr.c
+++ b/src/backends/randr.c
@@ -150,16 +150,6 @@ int randr_init(int screen_num, int crtc_num)
/* Save size and gamma ramps of all CRTCs.
Current gamma ramps are saved so we can restore them
at program exit. */
- /* Allocate space for saved gamma ramps */
- saved_ramps = malloc(state.crtc_count*3*ramp_size
- *sizeof(uint16_t));
- if ( !saved_ramps ) {
- perror("malloc");
- LOG(LOGERR,_("Memory allocation error."));
- free(gamma_get_reply);
- xcb_disconnect(state.conn);
- /*@i1@*/return RET_FUN_FAILED;
- }
for (i = 0; i < ((int)state.crtc_count); i++) {
/*@i2@*/xcb_randr_crtc_t crtc = state.crtcs[i].crtc;
@@ -209,7 +199,16 @@ int randr_init(int screen_num, int crtc_num)
gamma_r = xcb_randr_get_crtc_gamma_red(gamma_get_reply);
gamma_g = xcb_randr_get_crtc_gamma_green(gamma_get_reply);
gamma_b = xcb_randr_get_crtc_gamma_blue(gamma_get_reply);
-
+
+ /* Allocate space for saved gamma ramps */
+ state.crtcs[i].saved_ramps =
+ malloc(3*ramp_size*sizeof(uint16_t));
+ if (state.crtcs[i].saved_ramps == NULL) {
+ perror("malloc");
+ free(gamma_get_reply);
+ xcb_disconnect(state.conn);
+ /*@i1@*/return RET_FUN_FAILED;
+ };
/* Copy gamma ramps into CRTC state */
/*@i6@*/memcpy(state.crtcs[i].saved_ramps+0*ramp_size, gamma_r,
ramp_size*sizeof(uint16_t));
diff --git a/src/gui/iupgui.c b/src/gui/iupgui.c
index ede8bfd..8482510 100644
--- a/src/gui/iupgui.c
+++ b/src/gui/iupgui.c
@@ -156,7 +156,7 @@ int gui_popup(char *title,char *msg,char *type){
// Main GUI code
int iup_gui(int argc, char *argv[]){
(void)IupOpen( &argc,&argv );
- _load_icons(opt_get_active_icon(),opt_get_idle_icon());
+ _load_icons("","");
guimain_dialog_init();
guigamma_init_timers();
if( opt_get_disabled() )
--
2.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment