mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-23 19:39:06 +00:00
OpenBSD cleanups, remove unsupported printf flag and fix non-dynamic cpu_freq
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@964 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
0b8f5703bd
commit
60f4ea4fb7
14
src/conky.c
14
src/conky.c
@ -3577,7 +3577,13 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
||||
}
|
||||
OBJ(freq_g) {
|
||||
if (obj->a) {
|
||||
#ifndef __OpenBSD__
|
||||
obj->a = get_freq(p, p_max_size, "%'.2f", 1000, obj->data.cpu_index);
|
||||
#else
|
||||
/* OpenBSD has no such flag (SUSv2) */
|
||||
obj->a = get_freq(p, p_max_size, "%.2f", 1000, obj->data.cpu_index);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
#if defined(__linux__)
|
||||
@ -3640,9 +3646,17 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
||||
}
|
||||
OBJ(freq_dyn_g) {
|
||||
if (use_spacer) {
|
||||
#ifndef __OpenBSD__
|
||||
get_freq_dynamic(p, 6, "%'.2f ", 1000);
|
||||
#else
|
||||
get_freq_dynamic(p, 6, "%.2f ", 1000);
|
||||
#endif
|
||||
} else {
|
||||
#ifndef __OpenBSD__
|
||||
get_freq_dynamic(p, p_max_size, "%'.2f", 1000);
|
||||
#else
|
||||
get_freq_dynamic(p, p_max_size, "%.2f", 1000);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifndef __OpenBSD__
|
||||
|
@ -497,7 +497,7 @@ get_freq_dynamic(char *p_client_buffer, size_t client_buffer_size,
|
||||
snprintf(p_client_buffer, client_buffer_size, p_format,
|
||||
(float)((cycles[1] - cycles[0]) / microseconds) / divisor);
|
||||
#else
|
||||
get_freq(p_client_buffer, client_buffer_size, p_format, divisor);
|
||||
get_freq(p_client_buffer, client_buffer_size, p_format, divisor, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user