Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
fb2png: Fix compilation in android-9.0 repos.
Browse files Browse the repository at this point in the history
Remove unused reference.
Change temp variables to size_t.
Update function calls for unused arguments.
Update static functions to ignore being defined
for each file that includes it.
Change-Id: If11d4e26daee54197f369974a09ec71f27abb59b
  • Loading branch information
bigbiff committed Jun 6, 2019
1 parent ae7ff3b commit 3c897ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion fb2png/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static int fb_get_format(const struct fb *fb)
{
int ao = fb->alpha_offset;
int ro = fb->red_offset;
int go = fb->green_offset;
int bo = fb->blue_offset;

#define FB_FORMAT_UNKNOWN 0
Expand Down
16 changes: 8 additions & 8 deletions fb2png/img_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int rgb565_to_rgb888(const char* src, char* dst, size_t pixel)
from = (struct rgb565 *) src;
to = (struct rgb888 *) dst;

int i = 0;
size_t i = 0;
/* traverse pixel of the row */
while(i++ < pixel) {

Expand All @@ -53,7 +53,7 @@ int rgb565_to_rgb888(const char* src, char* dst, size_t pixel)

int argb8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
int i;
size_t i;
struct argb8888 *from;
struct rgb888 *to;

Expand All @@ -77,7 +77,7 @@ int argb8888_to_rgb888(const char* src, char* dst, size_t pixel)

int abgr8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
int i;
size_t i;
struct abgr8888 *from;
struct rgb888 *to;

Expand All @@ -101,7 +101,7 @@ int abgr8888_to_rgb888(const char* src, char* dst, size_t pixel)

int bgra8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
int i;
size_t i;
struct bgra8888 *from;
struct rgb888 *to;

Expand All @@ -125,7 +125,7 @@ int bgra8888_to_rgb888(const char* src, char* dst, size_t pixel)

int rgba8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
int i;
size_t i;
struct rgba8888 *from;
struct rgb888 *to;

Expand Down Expand Up @@ -164,19 +164,19 @@ stdio_write_func (png_structp png, png_bytep data, png_size_t size)
}

static void
png_simple_output_flush_fn (png_structp png_ptr)
png_simple_output_flush_fn (__attribute__((unused)) png_structp png_ptr)
{
}

static void
png_simple_error_callback (png_structp png,
png_simple_error_callback (__attribute__((unused)) png_structp png,
png_const_charp error_msg)
{
E("png error: %s\n", error_msg);
}

static void
png_simple_warning_callback (png_structp png,
png_simple_warning_callback (__attribute__((unused)) png_structp png,
png_const_charp error_msg)
{
fprintf(stderr, "png warning: %s\n", error_msg);
Expand Down
4 changes: 2 additions & 2 deletions fb2png/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#endif

static void
__attribute__((unused)) static void
D(const char *msg, ...)
{
va_list ap;
Expand All @@ -69,7 +69,7 @@ D(const char *msg, ...)
fflush(stdout);
}

static void
__attribute__((unused)) static void
E(const char *msg, ...)
{
va_list ap;
Expand Down

0 comments on commit 3c897ae

Please sign in to comment.