1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-04-14 17:53:25 -04:00

misc: fix warnings when building for arm, aarch64, and i686

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-10-17 00:00:54 +01:00
parent a1b4a49a6a
commit 035d28a073
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
4 changed files with 7 additions and 7 deletions

View file

@ -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,
@ -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

View file

@ -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;
}

View file

@ -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
}
@ -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;

View file

@ -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;