examples: Make all functions static

This fixes compiler warnings
pull/44/head v0.2.0
Andri Yngvason 2020-07-26 13:52:00 +00:00
parent bb5e4ef7e1
commit 6ad4aba374
2 changed files with 8 additions and 8 deletions

View File

@ -41,14 +41,14 @@ struct draw {
int index;
};
int coord_distance_between(struct coord a, struct coord b)
static int coord_distance_between(struct coord a, struct coord b)
{
float x = abs(a.x - b.x);
float y = abs(a.y - b.y);
return round(sqrt(x * x + y * y));
}
void draw_dot(struct nvnc_display* display, struct nvnc_fb* fb,
static void draw_dot(struct nvnc_display* display, struct nvnc_fb* fb,
struct coord coord, int radius, uint32_t colour)
{
uint32_t* image = nvnc_fb_get_addr(fb);
@ -77,7 +77,7 @@ void draw_dot(struct nvnc_display* display, struct nvnc_fb* fb,
}
}
void on_pointer_event(struct nvnc_client* client, uint16_t x, uint16_t y,
static void on_pointer_event(struct nvnc_client* client, uint16_t x, uint16_t y,
enum nvnc_button_mask buttons)
{
if (!(buttons & NVNC_BUTTON_LEFT))
@ -106,7 +106,7 @@ void on_pointer_event(struct nvnc_client* client, uint16_t x, uint16_t y,
pixman_region_fini(&region);
}
void on_render(struct nvnc_display* display, struct nvnc_fb* fb)
static void on_render(struct nvnc_display* display, struct nvnc_fb* fb)
{
struct nvnc* server = nvnc_display_get_server(display);
assert(server);
@ -120,7 +120,7 @@ void on_render(struct nvnc_display* display, struct nvnc_fb* fb)
draw->index = 0;
}
void on_sigint()
static void on_sigint()
{
aml_exit(aml_get_default());
}

View File

@ -24,7 +24,7 @@
struct nvnc_fb* read_png_file(const char* filename);
void on_sigint()
static void on_sigint()
{
aml_exit(aml_get_default());
}