Skip to content

Commit

Permalink
misc: fix warnings when building for arm, aarch64, and i686
Browse files Browse the repository at this point in the history
Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Oct 16, 2024
1 parent a1b4a49 commit 035d28a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/backend/gl/gl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ gl_blit_inner(struct gl_data *gd, GLuint target_fbo, int nrects, GLfloat *coord,
glBufferData(GL_ARRAY_BUFFER, vert_attribs->stride * nrects * 4, coord, GL_STREAM_DRAW);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * nrects * 6,
indices, GL_STREAM_DRAW);
for (ptrdiff_t i = 0; i < vert_attribs->count; i++) {
for (unsigned i = 0; i < vert_attribs->count; i++) {
auto attrib = &vert_attribs->attribs[i];
glEnableVertexAttribArray(attrib->loc);
glVertexAttribPointer(attrib->loc, 2, attrib->type, GL_FALSE,
Expand Down Expand Up @@ -917,7 +917,7 @@ bool gl_init(struct gl_data *gd, session_t *ps) {

glBindTexture(GL_TEXTURE_2D, gd->default_mask_texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, 1, 1, 0, GL_RED, GL_UNSIGNED_BYTE,
(GLbyte[]){'\xff'});
(GLubyte[]){0xff});
glBindTexture(GL_TEXTURE_2D, 0);

// Initialize shaders
Expand Down
4 changes: 2 additions & 2 deletions src/picom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,8 +1854,8 @@ static bool load_shader_source(session_t *ps, const char *path) {
auto read_bytes = fread(shader->source, sizeof(char), num_bytes, f);
if (read_bytes < num_bytes || ferror(f)) {
// This is a difficult to hit error case, review thoroughly.
log_error("Failed to read custom shader at %s. (read %lu bytes, expected "
"%lu bytes)",
log_error("Failed to read custom shader at %s. (read %zu bytes, expected "
"%zu bytes)",
path, read_bytes, num_bytes);
goto err;
}
Expand Down
4 changes: 2 additions & 2 deletions src/transition/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void log_instruction_(enum log_level level, const char *func, unsigned in
case INST_LOAD: logv("load %u", inst->slot); break;
case INST_STORE: logv("store %u", inst->slot); break;
case INST_STORE_OVER_NAN: logv("store/nan %u", inst->slot); break;
case INST_LOAD_CTX: logv("load_ctx *(%ld)", inst->ctx); break;
case INST_LOAD_CTX: logv("load_ctx *(%td)", inst->ctx); break;
}
#undef logv
}
Expand Down Expand Up @@ -129,7 +129,7 @@ char *instruction_to_c(struct instruction i) {
casprintf(&buf, "{.type = INST_STORE_OVER_NAN, .slot = %u},", i.slot);
break;
case INST_LOAD_CTX:
casprintf(&buf, "{.type = INST_LOAD_CTX, .ctx = %ld},", i.ctx);
casprintf(&buf, "{.type = INST_LOAD_CTX, .ctx = %td},", i.ctx);
break;
}
return buf;
Expand Down
2 changes: 1 addition & 1 deletion src/vblank.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct sgi_video_sync_vblank_scheduler {
// Since glXWaitVideoSyncSGI blocks, we need to run it in a separate thread.
// ... and all the thread shenanigans that come with it.
_Atomic unsigned int current_msc;
_Atomic uint64_t current_ust;
alignas(8) _Atomic uint64_t current_ust;
ev_async notify;
pthread_t sync_thread;
bool running, error, vblank_requested;
Expand Down

0 comments on commit 035d28a

Please sign in to comment.