libobs: Use byte sequence for non-breaking spaces

Use explicit UTF-8 byte sequence for the "no-break space" character.

Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:

warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
This commit is contained in:
jp9000 2015-10-15 01:00:14 -07:00
parent 2be5291a3e
commit 1bcbaf8e75
3 changed files with 14 additions and 8 deletions

View file

@ -1288,13 +1288,15 @@ static inline void query_hotkeys()
enum_bindings(query_hotkey, &param);
}
#define NBSP "\xC2\xA0"
void *obs_hotkey_thread(void *arg)
{
UNUSED_PARAMETER(arg);
const char *hotkey_thread_name =
profile_store_name(obs_get_profiler_name_store(),
"obs_hotkey_thread(%g ms)", 25.);
"obs_hotkey_thread(%g"NBSP"ms)", 25.);
profile_register_root(hotkey_thread_name, (uint64_t)25000000);
while (os_event_timedwait(obs->hotkeys.stop_event, 25) == ETIMEDOUT) {

View file

@ -601,6 +601,8 @@ static inline void output_frame(void)
video->cur_texture = 0;
}
#define NBSP "\xC2\xA0"
static const char *tick_sources_name = "tick_sources";
static const char *render_displays_name = "render_displays";
static const char *output_frame_name = "output_frame";
@ -615,7 +617,7 @@ void *obs_video_thread(void *param)
const char *video_thread_name =
profile_store_name(obs_get_profiler_name_store(),
"obs_video_thread(%g ms)", interval / 1000000.);
"obs_video_thread(%g"NBSP"ms)", interval / 1000000.);
profile_register_root(video_thread_name, interval);
while (!video_output_stopped(obs->video.video)) {

View file

@ -561,6 +561,8 @@ static void gather_stats(uint64_t expected_time_between_calls,
*percent_within_bounds = (1. - (double)accu / calls) * 100;
}
#define G_MS "g\xC2\xA0ms"
static void profile_print_entry(profiler_snapshot_entry_t *entry,
struct dstr *indent_buffer, struct dstr *output_buffer,
unsigned indent, uint64_t active, uint64_t parent_calls)
@ -578,12 +580,12 @@ static void profile_print_entry(profiler_snapshot_entry_t *entry,
make_indent_string(indent_buffer, indent, active);
if (min_ == max_) {
dstr_printf(output_buffer, "%s%s: %g ms",
dstr_printf(output_buffer, "%s%s: %"G_MS,
indent_buffer->array, entry->name,
min_ / 1000.);
} else {
dstr_printf(output_buffer, "%s%s: min=%g ms, median=%g ms, "
"max=%g ms, 99th percentile=%g ms",
dstr_printf(output_buffer, "%s%s: min=%"G_MS", median=%"G_MS", "
"max=%"G_MS", 99th percentile=%"G_MS,
indent_buffer->array, entry->name,
min_ / 1000., median / 1000., max_ / 1000.,
percentile99 / 1000.);
@ -591,7 +593,7 @@ static void profile_print_entry(profiler_snapshot_entry_t *entry,
if (entry->expected_time_between_calls) {
double expected_ms =
entry->expected_time_between_calls / 1000.;
dstr_catf(output_buffer, ", %g%% below %g ms",
dstr_catf(output_buffer, ", %g%% below %"G_MS,
percent_within_bounds, expected_ms);
}
}
@ -707,8 +709,8 @@ static void profile_print_entry_expected(profiler_snapshot_entry_t *entry,
make_indent_string(indent_buffer, indent, active);
blog(LOG_INFO, "%s%s: min=%g ms, median=%g ms, max=%g ms, %g%% "
"within ±2%% of %g ms (%g%% lower, %g%% higher)",
blog(LOG_INFO, "%s%s: min=%"G_MS", median=%"G_MS", max=%"G_MS", %g%% "
"within ±2%% of %"G_MS" (%g%% lower, %g%% higher)",
indent_buffer->array, entry->name,
min_ / 1000., median / 1000., max_ / 1000., percent,
expected_time / 1000.,