diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cdbc118a..a7524cf4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -142,7 +142,7 @@ if(BUILD_LUA) endif(BUILD_LUA) if(BUILD_NVIDIA) - set(nvidia nvidia.c) + set(nvidia nvidia.cc) set(optional_sources ${optional_sources} ${nvidia}) endif(BUILD_NVIDIA) diff --git a/src/nvidia.c b/src/nvidia.cc similarity index 94% rename from src/nvidia.c rename to src/nvidia.cc index 4344b87b..6db89ecb 100644 --- a/src/nvidia.c +++ b/src/nvidia.cc @@ -1,5 +1,5 @@ /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- - * vim: ts=4 sw=4 noet ai cindent syntax=c + * vim: ts=4 sw=4 noet ai cindent syntax=cpp * * Conky, a system monitor, based on torsmo * @@ -74,7 +74,8 @@ int set_nvidia_type(struct text_object *obj, const char *arg) { struct nvidia_s *nvs; - nvs = obj->data.opaque = malloc(sizeof(struct nvidia_s)); + obj->data.opaque = malloc(sizeof(struct nvidia_s)); + nvs = static_cast(obj->data.opaque); memset(nvs, 0, sizeof(struct nvidia_s)); switch(arg[0]) { @@ -109,7 +110,7 @@ int set_nvidia_type(struct text_object *obj, const char *arg) void print_nvidia_value(struct text_object *obj, char *p, int p_max_size) { int value; - struct nvidia_s *nvs = obj->data.opaque; + struct nvidia_s *nvs = static_cast(obj->data.opaque); if (!nvs || (value = get_nvidia_value(nvs->type, display)) == -1) {