* Boston, MA 02111-1307, USA.
*/
-#include <config.h>
+#include "config.h"
#include <stdio.h>
#include <string.h>
#include "gdk-pixbuf-private.h"
context->header = g_try_malloc(sizeof(struct pcx_header));
if(!context->header) {
g_free(context);
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for header"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for header"));
return NULL;
}
if(!context->buf) {
g_free(context->header);
g_free(context);
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for context buffer"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for context buffer"));
return NULL;
}
context->buf_size = 512;
/* if context's buf isn't large enough to hold its current data plus the passed buf, increase its size */
if(context->buf_pos + size > context->buf_size) {
if(!pcx_resize_context_buf(context, sizeof(guchar) * (context->buf_pos + size))) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for context buffer"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for context buffer"));
return FALSE;
}
}
width = context->width;
height = context->height;
if(width <= 0 || height <= 0) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Image has invalid width and/or height"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Image has invalid width and/or height"));
return FALSE;
}
if (context->size_func)
switch(context->bpp) {
default:
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported bpp"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported bpp"));
return FALSE;
break;
case 1:
context->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, context->width, context->height);
if(!context->pixbuf) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't create new pixbuf"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't create new pixbuf"));
return FALSE;
}
context->data = gdk_pixbuf_get_pixels(context->pixbuf);
context->line = g_try_malloc(sizeof(guchar) * context->bytesperline * context->num_planes);
if(!context->line) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for line data"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for line data"));
return FALSE;
}
if(context->bpp == 8) {
context->p_data = g_try_malloc(sizeof(guchar) * context->width * context->height);
if(!context->p_data) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for paletted data"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Couldn't allocate memory for paletted data"));
return FALSE;
}
}
if(context->current_task == PCX_TASK_LOAD_DATA) {
switch(context->bpp) {
default:
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported bpp"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, _("Image has unsupported bpp"));
retval = FALSE;
break;
case 1:
struct pcx_context *context = (struct pcx_context *)data;
if(context->current_line != context->height) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, _("Didn't get all lines of PCX image"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, _("Didn't get all lines of PCX image"));
free_pcx_context(context, FALSE);
return FALSE;
}
if(context->current_task == PCX_TASK_LOAD_PALETTE) {
if(!pcx_load_palette_8(context)) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, _("No palette found at end of PCX data"));
+ g_set_error_literal(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, _("No palette found at end of PCX data"));
free_pcx_context(context, FALSE);
return FALSE;
}
}
#ifndef INCLUDE_pcx
-#define MODULE_ENTRY(type,function) function
+#define MODULE_ENTRY(function) G_MODULE_EXPORT void function
#else
-#define MODULE_ENTRY(type,function) _gdk_pixbuf__ ## type ## _ ## function
+#define MODULE_ENTRY(function) void _gdk_pixbuf__pcx_ ## function
#endif
-void
-MODULE_ENTRY (pcx, fill_vtable) (GdkPixbufModule *module)
+MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__pcx_begin_load;
module->stop_load = gdk_pixbuf__pcx_stop_load;
module->load_increment = gdk_pixbuf__pcx_load_increment;
}
-void
-MODULE_ENTRY (pcx, fill_info) (GdkPixbufFormat *info)
+MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "\x0a \x01", NULL, 100 },