Skip to content

Commit

Permalink
examples: Make all functions static
Browse files Browse the repository at this point in the history
This fixes compiler warnings
  • Loading branch information
any1 committed Jul 26, 2020
1 parent bb5e4ef commit 6ad4aba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions examples/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ 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,
struct coord coord, int radius, uint32_t colour)
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);
int width = nvnc_fb_get_width(fb);
Expand Down Expand Up @@ -77,8 +77,8 @@ 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,
enum nvnc_button_mask buttons)
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))
return;
Expand Down Expand Up @@ -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);
Expand All @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion examples/png-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 6ad4aba

Please sign in to comment.