Skip to content

Commit

Permalink
optimizer: fix compiler warnings
Browse files Browse the repository at this point in the history
Define _GNU_SOURCE on Linux, to avoid warnings about pthread_setname_np being
implicitly defined.

Add parentheses around assignment as loop condition.

Set C++11 as the standard.
  • Loading branch information
jamienicol committed Jul 27, 2020
1 parent 7040870 commit fccb278
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(glsl_optimizer VERSION 0.1
DESCRIPTION "GLSL Optimizer"
LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 11)

include_directories(include)
include_directories(src/mesa)
include_directories(src/mapi)
Expand All @@ -16,6 +18,7 @@ include_directories(src/util)

add_definitions(-D__STDC_FORMAT_MACROS)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-D_GNU_SOURCE)
add_definitions(-DHAVE_ENDIAN_H)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/glsl/ir_print_glsl_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ ir_print_glsl_visitor::visit(ir_typedecl_statement *ir)

// Find a variable defined by this interface, as it holds some necessary data.
exec_node* n = ir;
while (n = n->get_next()) {
while ((n = n->get_next())) {
ir_variable* v = ((ir_instruction *)n)->as_variable();
if (v != NULL && v->get_interface_type() == ir->type_decl) {
interface_var = v;
Expand Down

0 comments on commit fccb278

Please sign in to comment.