Skip to content

Commit

Permalink
fix most of build warnings on openbsd
Browse files Browse the repository at this point in the history
sorry openbsd people, we're not going to use the snprintf function.
  • Loading branch information
absolutelynothelix committed Feb 13, 2024
1 parent f179119 commit 53dd8a4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/backend/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ bool paint_all_new(session_t *ps, struct managed_win *const t) {
auto after_damage_us = (uint64_t)now.tv_sec * 1000000UL + (uint64_t)now.tv_nsec / 1000;
log_trace("Getting damage took %" PRIu64 " us", after_damage_us - after_sync_fence_us);
if (ps->next_render > 0) {
log_verbose("Render schedule deviation: %ld us (%s) %" PRIu64 " %ld",
log_verbose("Render schedule deviation: %ld us (%s) %" PRIu64 " %" PRIu64,
labs((long)after_damage_us - (long)ps->next_render),
after_damage_us < ps->next_render ? "early" : "late",
after_damage_us, ps->next_render);
Expand Down
5 changes: 1 addition & 4 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ const char *xdg_config_home(void) {
return NULL;
}

xdgh = cvalloc(strlen(home) + strlen(default_dir) + 1);

strcpy(xdgh, home);
strcat(xdgh, default_dir);
xdgh = mstrjoin(home, default_dir);
} else {
xdgh = strdup(xdgh);
}
Expand Down
8 changes: 5 additions & 3 deletions src/picom.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ collect_vblank_interval_statistics(struct vblank_event *e, void *ud) {
if (frame_count == 1) {
render_statistics_add_vblank_time_sample(
&ps->render_stats, frame_time);
log_trace("Frame count %lu, frame time: %d us, ust: "
"%" PRIu64 "",
log_trace("Frame count %" PRIu64 ", frame time: %d us, "
"ust: "
"%" PRIu64,
frame_count, frame_time, e->ust);
} else {
log_trace("Frame count %lu, frame time: %d us, msc: "
log_trace("Frame count %" PRIu64 ", frame time: %d us, "
"msc: "
"%" PRIu64 ", not adding sample.",
frame_count, frame_time, e->ust);
}
Expand Down
6 changes: 3 additions & 3 deletions src/vblank.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ sgi_video_sync_scheduler_callback(EV_P attr_unused, ev_async *w, int attr_unused
};
sched->base.vblank_event_requested = false;
sched->last_msc = msc;
log_verbose("Received vblank event for msc %lu", event.msc);
log_verbose("Received vblank event for msc %" PRIu64, event.msc);
vblank_scheduler_invoke_callbacks(&sched->base, &event);
}
#endif
Expand Down Expand Up @@ -411,7 +411,7 @@ static void handle_present_complete_notify(struct present_vblank_scheduler *self
auto now_us = (unsigned long)(now.tv_sec * 1000000L + now.tv_nsec / 1000);
double delay_sec = 0.0;
if (now_us < cne->ust) {
log_trace("The end of this vblank is %lu us into the "
log_trace("The end of this vblank is %" PRIu64 " us into the "
"future",
cne->ust - now_us);
delay_sec = (double)(cne->ust - now_us) / 1000000.0;
Expand Down Expand Up @@ -566,4 +566,4 @@ bool vblank_handle_x_events(struct vblank_scheduler *self) {
return fn(self);
}
return true;
}
}
3 changes: 2 additions & 1 deletion src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
// Whether the window was visible before we process the mapped flag. i.e.
// is the window just mapped.
bool was_visible = win_is_real_visible(w);
log_trace("Processing flags for window %#010x (%s), was visible: %d, flags: %#lx",
log_trace("Processing flags for window %#010x (%s), was visible: %d, flags: "
"%#" PRIx64,
w->base.id, w->name, was_visible, w->flags);

if (win_check_flags_all(w, WIN_FLAGS_MAPPED)) {
Expand Down

0 comments on commit 53dd8a4

Please sign in to comment.