From 08aecd42a842676802995676be7f982e7b51dcb5 Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Wed, 16 Dec 2020 07:57:49 +0000 Subject: [PATCH] uPDF: clean warnings, move opj_config.h to libopenjpeg folder git-svn-id: svn://kolibrios.org@8416 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/media/updf_newlib/apps/Makefile | 3 ++ contrib/media/updf_newlib/apps/kolibri.c | 1 + contrib/media/updf_newlib/apps/kolibri.h | 7 ++- contrib/media/updf_newlib/apps/kos_main.c | 8 +++- contrib/media/updf_newlib/apps/pdfapp.c | 2 +- contrib/media/updf_newlib/apps/resource.h | 47 ------------------- .../updf_newlib/{compile.sh => build_libs.sh} | 0 .../media/updf_newlib/libopenjpeg/openjpeg.c | 2 +- .../{ => libopenjpeg}/opj_config.h | 0 9 files changed, 19 insertions(+), 51 deletions(-) rename contrib/media/updf_newlib/{compile.sh => build_libs.sh} (100%) rename contrib/media/updf_newlib/{ => libopenjpeg}/opj_config.h (100%) diff --git a/contrib/media/updf_newlib/apps/Makefile b/contrib/media/updf_newlib/apps/Makefile index 346ae62472..ca5796696c 100755 --- a/contrib/media/updf_newlib/apps/Makefile +++ b/contrib/media/updf_newlib/apps/Makefile @@ -19,3 +19,6 @@ default: $(patsubst %.c,%.o,$(APPS_SRC)) %.o : %.c Makefile $(APPS_SRC) $(CC) $(CFLAGS) $(INCLUDES) -o $@ $< + +clean: + rm *.o diff --git a/contrib/media/updf_newlib/apps/kolibri.c b/contrib/media/updf_newlib/apps/kolibri.c index 3471e445cf..91d3b2c22a 100755 --- a/contrib/media/updf_newlib/apps/kolibri.c +++ b/contrib/media/updf_newlib/apps/kolibri.c @@ -1,5 +1,6 @@ #include "kolibri.h" #include "string.h" +#include extern char KOL_PATH[256]; diff --git a/contrib/media/updf_newlib/apps/kolibri.h b/contrib/media/updf_newlib/apps/kolibri.h index 6da79c023a..93c7acd14d 100755 --- a/contrib/media/updf_newlib/apps/kolibri.h +++ b/contrib/media/updf_newlib/apps/kolibri.h @@ -1,5 +1,7 @@ +#ifndef NULL #define NULL ((void*)0) +#endif #define SHM_OPEN 0 #define SHM_OPEN_ALWAYS 0x04 @@ -46,7 +48,7 @@ typedef struct { unsigned p00; unsigned p04; -unsigned p08; +char *p08; unsigned p12; unsigned p16; char p20; @@ -143,3 +145,6 @@ int kol_clip_num(); char* kol_clip_get(int n); int kol_clip_set(int n, char buffer[]); +void kos_blit(int dstx, int dsty, int w, int h, int srcx, + int srcy,int srcw, int srch, int stride, char *d); +int kos_random(int num); diff --git a/contrib/media/updf_newlib/apps/kos_main.c b/contrib/media/updf_newlib/apps/kos_main.c index ccc2616f67..40ecfc81a4 100755 --- a/contrib/media/updf_newlib/apps/kos_main.c +++ b/contrib/media/updf_newlib/apps/kos_main.c @@ -2,7 +2,6 @@ #include "resource.h" #include -#define _WIN32 #include "fitz.h" #include "mupdf.h" #include "pdfapp.h" @@ -56,6 +55,13 @@ const char *help[] = { }; /*==== CODE ====*/ +// Prototypes // +void RunApp(char app[], char param[]); +void winblit(pdfapp_t *app); +void DrawPagination(void); +void HandleNewPageNumber(unsigned char key); +void ApplyNewPageNumber(void); +void DrawWindow(void); // not implemented yet diff --git a/contrib/media/updf_newlib/apps/pdfapp.c b/contrib/media/updf_newlib/apps/pdfapp.c index 0b5ae5cd90..5e2b88be1f 100755 --- a/contrib/media/updf_newlib/apps/pdfapp.c +++ b/contrib/media/updf_newlib/apps/pdfapp.c @@ -2,7 +2,7 @@ #include "mupdf.h" #include "pdfapp.h" -// #include /* for tolower() */ +#include /* for tolower() */ #define ZOOMSTEP 1.142857 #define BEYOND_THRESHHOLD 40 diff --git a/contrib/media/updf_newlib/apps/resource.h b/contrib/media/updf_newlib/apps/resource.h index 74bd3f129f..392295123b 100755 --- a/contrib/media/updf_newlib/apps/resource.h +++ b/contrib/media/updf_newlib/apps/resource.h @@ -1,21 +1,5 @@ -#ifndef __dj_include_sys_resource_h_ -#define __dj_include_sys_resource_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __dj_ENFORCE_ANSI_FREESTANDING - -#ifndef __STRICT_ANSI__ - -#ifndef _POSIX_SOURCE - #include -#define RUSAGE_SELF 0 /* calling process */ -#define RUSAGE_CHILDREN -1 /* terminated child processes */ - struct rusage { struct timeval ru_utime; /* user time used */ struct timeval ru_stime; /* system time used */ @@ -35,36 +19,5 @@ struct rusage { long ru_nivcsw; /* involuntary context switches */ }; -#define RLIMIT_CPU 0 /* cpu time in milliseconds */ -#define RLIMIT_FSIZE 1 /* maximum file size */ -#define RLIMIT_DATA 2 /* data size */ -#define RLIMIT_STACK 3 /* stack size */ -#define RLIMIT_CORE 4 /* core file size */ -#define RLIMIT_RSS 5 /* resident set size */ -#define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */ -#define RLIMIT_NPROC 7 /* number of processes */ -#define RLIMIT_NOFILE 8 /* number of open files */ - -#define RLIM_NLIMITS 9 /* number of resource limits */ -#define RLIM_INFINITY ((long) ((1UL << 31) - 1UL)) - -struct rlimit { - long rlim_cur; /* current (soft) limit */ - long rlim_max; /* maximum value for rlim_cur */ -}; - /// STUB /// int getrusage(int _who, struct rusage *_rusage) {}; - -#endif /* !_POSIX_SOURCE */ -#endif /* !__STRICT_ANSI__ */ -#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ - -#ifndef __dj_ENFORCE_FUNCTION_CALLS -#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ - -#ifdef __cplusplus -} -#endif - -#endif /* !__dj_include_sys_resource_h_ */ diff --git a/contrib/media/updf_newlib/compile.sh b/contrib/media/updf_newlib/build_libs.sh similarity index 100% rename from contrib/media/updf_newlib/compile.sh rename to contrib/media/updf_newlib/build_libs.sh diff --git a/contrib/media/updf_newlib/libopenjpeg/openjpeg.c b/contrib/media/updf_newlib/libopenjpeg/openjpeg.c index d95cfc91b9..6722b33dca 100755 --- a/contrib/media/updf_newlib/libopenjpeg/openjpeg.c +++ b/contrib/media/updf_newlib/libopenjpeg/openjpeg.c @@ -28,7 +28,7 @@ #include #endif /* _WIN32 */ -#include "../opj_config.h" +#include "opj_config.h" #include "opj_includes.h" /* ---------------------------------------------------------------------- */ diff --git a/contrib/media/updf_newlib/opj_config.h b/contrib/media/updf_newlib/libopenjpeg/opj_config.h similarity index 100% rename from contrib/media/updf_newlib/opj_config.h rename to contrib/media/updf_newlib/libopenjpeg/opj_config.h