summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.mak2
-rw-r--r--src/svg/cdsvg.c19
-rw-r--r--src/x11/cdx11.c8
3 files changed, 16 insertions, 13 deletions
diff --git a/src/config.mak b/src/config.mak
index 05b5182..725b87d 100644
--- a/src/config.mak
+++ b/src/config.mak
@@ -4,7 +4,7 @@ OPT = YES
DEFINES = CD_NO_OLD_INTERFACE
-SRCSVG = base64.c lodpng.c cdsvg.c
+SRCSVG = base64.c lodepng.c cdsvg.c
SRCSVG := $(addprefix svg/, $(SRCSVG))
SRCINTCGM = circle.c ellipse.c intcgm1.c \
diff --git a/src/svg/cdsvg.c b/src/svg/cdsvg.c
index 693791b..d44e40a 100644
--- a/src/svg/cdsvg.c
+++ b/src/svg/cdsvg.c
@@ -19,7 +19,7 @@
#include "lodepng.h"
#include "base64.h"
-typedef struct _cdCtxCanvas
+struct _cdCtxCanvas
{
cdCanvas* canvas;
char* filename;
@@ -55,7 +55,7 @@ typedef struct _cdCtxCanvas
int transform_control;
FILE* file;
-} cdCtxCanvas;
+};
static void cdkillcanvas(cdCtxCanvas* ctxcanvas)
{
@@ -726,8 +726,9 @@ static long cdforeground(cdCtxCanvas *ctxcanvas, long int color)
static void cdputimagerectrgb(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsigned char *r, const unsigned char *g, const unsigned char *b, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax)
{
- int i, j, d, rw, rh, rgb_size, buffer_size, target_size;
+ int i, j, d, rw, rh, rgb_size, target_size;
unsigned char* rgb_data, *rgb_buffer;
+ size_t buffer_size;
LodePNG_Encoder encoder;
char* rgb_target;
@@ -753,7 +754,7 @@ static void cdputimagerectrgb(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsi
}
LodePNG_Encoder_init(&encoder);
- LodePNG_encode(&encoder, &rgb_buffer, &(size_t)buffer_size, rgb_data, rw, rh);
+ LodePNG_encode(&encoder, &rgb_buffer, &buffer_size, rgb_data, rw, rh);
target_size = (buffer_size+2)/3*4+1;
rgb_target = (char*)malloc(target_size);
@@ -774,7 +775,8 @@ static void cdputimagerectrgb(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsi
static void cdputimagerectrgba(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsigned char *r, const unsigned char *g, const unsigned char *b, const unsigned char *a, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax)
{
- int i, j, d, rw, rh, rgb_size, buffer_size, target_size;
+ int i, j, d, rw, rh, rgb_size, target_size;
+ size_t buffer_size;
unsigned char* rgb_data, *rgb_buffer;
LodePNG_Encoder encoder;
char* rgb_target;
@@ -801,7 +803,7 @@ static void cdputimagerectrgba(cdCtxCanvas *ctxcanvas, int iw, int ih, const uns
}
LodePNG_Encoder_init(&encoder);
- LodePNG_encode(&encoder, &rgb_buffer, &(size_t)buffer_size, rgb_data, rw, rh);
+ LodePNG_encode(&encoder, &rgb_buffer, &buffer_size, rgb_data, rw, rh);
target_size = (buffer_size+2)/3*4+1;
rgb_target = (char*)malloc(target_size);
@@ -822,8 +824,9 @@ static void cdputimagerectrgba(cdCtxCanvas *ctxcanvas, int iw, int ih, const uns
static void cdputimagerectmap(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsigned char *index, const long int *colors, int x, int y, int w, int h, int xmin, int xmax, int ymin, int ymax)
{
- int i, j, d, rw, rh, rgb_size, buffer_size, target_size;
+ int i, j, d, rw, rh, rgb_size, target_size;
unsigned char* rgb_data, *rgb_buffer;
+ size_t buffer_size;
LodePNG_Encoder encoder;
char* rgb_target;
@@ -851,7 +854,7 @@ static void cdputimagerectmap(cdCtxCanvas *ctxcanvas, int iw, int ih, const unsi
}
LodePNG_Encoder_init(&encoder);
- LodePNG_encode(&encoder, &rgb_buffer, &(size_t)buffer_size, rgb_data, rw, rh);
+ LodePNG_encode(&encoder, &rgb_buffer, &buffer_size, rgb_data, rw, rh);
target_size = (buffer_size+2)/3*4+1;
rgb_target = (char*)malloc(target_size);
diff --git a/src/x11/cdx11.c b/src/x11/cdx11.c
index bbc9420..88bd184 100644
--- a/src/x11/cdx11.c
+++ b/src/x11/cdx11.c
@@ -56,10 +56,10 @@ static int cdxErrorHandler(Display* dpy, XErrorEvent *err)
if (err->request_code==X_FreeColors && err->error_code==BadAccess)
return 0;
- XGetErrorText(dpy, err->error_code, msg, 80 );
- fprintf(stderr,"CanvasDraw: Xlib request %d: %s\n", err->request_code, msg);
+ XGetErrorText(dpy, err->error_code, msg, 80);
+ fprintf(stderr,"X Error of failed request %d: %s\n", err->request_code, msg);
- return 0;
+ return 0; /* ignore always */
}
static void update_colors(cdCtxCanvas *ctxcanvas)
@@ -2383,7 +2383,7 @@ cdCtxCanvas *cdxCreateCanvas(cdCanvas* canvas, Display *dpy, int scr, Drawable w
if (first)
{
- if(!getenv("CD_XERROR"))
+ if (!getenv("CD_XERROR"))
XSetErrorHandler(cdxErrorHandler);
}