This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, generate has been updated via 9af82e35bed6a38c5599afcd4d0e0ac3450299a5 (commit) via ad753048dfe4082af1e4573c2c5d19c4cd4c6026 (commit) from e5540ad2e0e262ef503332e7aa03168ef6ac072e (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/9af82e35bed6a38c5599afcd4d0e0ac345029...
commit 9af82e35bed6a38c5599afcd4d0e0ac3450299a5 Author: Cyril Hrubis metan@ucw.cz Date: Mon Jul 18 11:08:24 2011 +0200
Fix off by one bug causing segfaults.
diff --git a/libs/gfx/algo/Line.algo.h b/libs/gfx/algo/Line.algo.h index c1c2c2d..3eccb3a 100644 --- a/libs/gfx/algo/Line.algo.h +++ b/libs/gfx/algo/Line.algo.h @@ -66,10 +66,12 @@ void FN_NAME(CONTEXT_T context, int x0, int y0, int x1, int y1, int error = deltax / 2; int y = y0, x; int ystep = (y0 < y1) ? 1 : -1; - for (x = x0; x <= x1; x++) { + for (x = x0; x < x1; x++) { - if (steep) PUTPIXEL(context, y, x, pixval); - else PUTPIXEL(context, x, y, pixval); + if (steep) + PUTPIXEL(context, y, x, pixval); + else + PUTPIXEL(context, x, y, pixval); error = error - deltay; if (error < 0) { http://repo.or.cz/w/gfxprim.git/commit/ad753048dfe4082af1e4573c2c5d19c4cd4c6...
commit ad753048dfe4082af1e4573c2c5d19c4cd4c6026 Author: Cyril Hrubis metan@ucw.cz Date: Mon Jul 18 10:59:03 2011 +0200
Coding style, typos.
diff --git a/include/core/GP_Common.h b/include/core/GP_Common.h index cda1967..3bae989 100644 --- a/include/core/GP_Common.h +++ b/include/core/GP_Common.h @@ -164,7 +164,7 @@ #define GP_SET_BITS(offset, count, dest, val) do { GP_CLEAR_BITS(offset, count, dest); GP_SET_BITS_OR(offset, dest, val); - } while (0) +} while (0)
/* * Debugging version, evaluates args twice. @@ -172,7 +172,7 @@ #define GP_SET_BITS_DBG(offset, count, dest, val) do { GP_SET_BITS(offset, count, dest, val); printf("SET_BITS(%d, %d, p, %d)n", offset, count, val); - } while (0) +} while (0)
/* Determines the sign of the integer value; it is +1 if value is positive, diff --git a/include/core/GP_GetPutPixel.h b/include/core/GP_GetPutPixel.h index 12e9af4..9d9b7be 100644 --- a/include/core/GP_GetPutPixel.h +++ b/include/core/GP_GetPutPixel.h @@ -57,11 +57,10 @@ static inline GP_Pixel GP_GetPixel_Raw(const GP_Context *context, int x, int y) */ void GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel p);
+//TODO: This is the same as GP_PutPixel static inline void GP_TPutPixel(GP_Context *context, GP_Coord x, GP_Coord y, GP_Pixel p) { - GP_TRANSFORM_POINT(context, x, y); - GP_PutPixel(context, x, y, p); }
diff --git a/include/core/GP_Pixel.h b/include/core/GP_Pixel.h index de2b4a5..99793f1 100644 --- a/include/core/GP_Pixel.h +++ b/include/core/GP_Pixel.h @@ -19,7 +19,7 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * * * * Copyright (C) 2011 Tomas Gavenciak gavento@ucw.cz * * * @@ -52,7 +52,7 @@ struct GP_Context; * GP_Pixel is just uint32_t */ typedef uint32_t GP_Pixel; -#define GP_PIXEL_BITS 32 +#define GP_PIXEL_BITS (sizeof(GP_Pixel) * 8)
/* Generated header */ #include "GP_Pixel.gen.h" @@ -81,9 +81,9 @@ typedef enum { */
typedef struct { - char name[8]; /* Channel name */ - uint8_t offset; /* Offset in bits */ - uint8_t size; /* Bit-size */ + char name[8]; /* Channel name */ + uint8_t offset; /* Offset in bits */ + uint8_t size; /* Bit-size */ } GP_PixelTypeChannel;
/* @@ -99,15 +99,15 @@ typedef struct { */
typedef struct { - GP_PixelType type; /* Number of the type */ - const char name[16]; /* Name */ - uint8_t size; /* Size in bits */ - GP_BIT_ENDIAN bit_endian; /* Order of pixels in a byte */ - uint8_t numchannels; /* Number of channels */ - /* String describing the bit-representaton (as in "RRRRRGGGGGGBBBBB")*/ - const char bitmap[sizeof(GP_Pixel) * 8 + 1]; - /* Individual channels */ - const GP_PixelTypeChannel channels[GP_PIXELTYPE_MAX_CHANNELS]; + GP_PixelType type; /* Number of the type */ + const char name[16]; /* Name */ + uint8_t size; /* Size in bits */ + GP_BIT_ENDIAN bit_endian; /* Order of pixels in a byte */ + uint8_t numchannels; /* Number of channels */ + /* String describing the bit-representaton (as in "RRRRRGGGGGGBBBBB")*/ + const char bitmap[sizeof(GP_Pixel) * 8 + 1]; + /* Individual channels */ + const GP_PixelTypeChannel channels[GP_PIXELTYPE_MAX_CHANNELS]; } GP_PixelTypeDescription;
/*
-----------------------------------------------------------------------
Summary of changes: include/core/GP_Common.h | 4 ++-- include/core/GP_GetPutPixel.h | 3 +-- include/core/GP_Pixel.h | 28 ++++++++++++++-------------- libs/gfx/algo/Line.algo.h | 8 +++++--- 4 files changed, 22 insertions(+), 21 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.