From e1318d75bec41f219ae0ff0c68e55238ca217a33 Mon Sep 17 00:00:00 2001 From: Graeme Hill Date: Sun, 18 Jun 2017 14:45:30 -0700 Subject: [PATCH] Enable optimizations --- CMakeLists.txt | 1 + Guid.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b70b540..afa94f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5.1) project(CrossGuid) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") option(XG_TESTS "Build test runner" ON) diff --git a/Guid.cpp b/Guid.cpp index bd8c61c..ca0c6be 100644 --- a/Guid.cpp +++ b/Guid.cpp @@ -184,7 +184,8 @@ unsigned char hexPairToChar(char a, char b) // create a guid from string Guid::Guid(const std::string &fromString) { - char charOne, charTwo; + char charOne = '\0'; + char charTwo = '\0'; bool lookingForFirstChar = true; unsigned nextByte = 0;