about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libppmd.c18
-rw-r--r--lib/ppmdraw.h4
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/libppmd.c b/lib/libppmd.c
index ac8b6dee..f2852338 100644
--- a/lib/libppmd.c
+++ b/lib/libppmd.c
@@ -114,7 +114,7 @@ ppmd_filledrectangle(pixel **      const pixels,
 
     /* Draw. */
     for (row = cy; row < cy + cheight; ++row) {
-        unsigned int col;
+        int col;
         for (col = cx; col < cx + cwidth; ++col)
             drawPoint(drawProc, clientdata,
                       pixels, cols, rows, maxval, col, row);
@@ -676,6 +676,22 @@ ppmd_fill_create(void) {
 
 
 
+char *
+ppmd_fill_init(void) {
+/*----------------------------------------------------------------------------
+   Backward compatibility interface.  This is what was used before
+   ppmd_fill_create() existed.
+
+   Note that old programs treat a fill handle as a pointer to char
+   rather than a pointer to fillObj, and backward compatibility
+   depends upon the fact that these are implemented as identical types
+   (an address).
+-----------------------------------------------------------------------------*/
+    return (char *)ppmd_fill_create();
+}
+
+
+
 void
 ppmd_fill_destroy(struct fillobj * fillObjP) {
 
diff --git a/lib/ppmdraw.h b/lib/ppmdraw.h
index 6a379573..7441cc43 100644
--- a/lib/ppmdraw.h
+++ b/lib/ppmdraw.h
@@ -237,6 +237,10 @@ ppmd_fill_create(void);
 void
 ppmd_fill_destroy(struct fillobj * fillObjP);
 
+/* For backward compatibility only: */
+char *
+ppmd_fill_init(void);
+
 void
 ppmd_fill_drawproc(pixel ** const pixels, 
                    int      const cols,