about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-07-28 17:43:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-07-28 17:43:45 +0000
commitbc388cc0c2ca31a67df1e1cecbd3b34f58d0da8a (patch)
treeb450c1907efa60155a1dfb734a24f6b37c7c7ba2 /editor
parent1e77fa9f5744744d8775e3aebf97f153fec31f22 (diff)
downloadnetpbm-mirror-bc388cc0c2ca31a67df1e1cecbd3b34f58d0da8a.tar.gz
netpbm-mirror-bc388cc0c2ca31a67df1e1cecbd3b34f58d0da8a.tar.xz
netpbm-mirror-bc388cc0c2ca31a67df1e1cecbd3b34f58d0da8a.zip
Whoops doesn't actually compile yet. Make it compile
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4372 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r--editor/pamcat.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/editor/pamcat.c b/editor/pamcat.c
index 63fffca3..c7d62e66 100644
--- a/editor/pamcat.c
+++ b/editor/pamcat.c
@@ -699,7 +699,7 @@ createLrImgCtlArray(const struct pam *  const inpam,  /* array */
     MALLOCARRAY_NOFAIL(imgCtl, fileCt);
 
     for (i = 0; i < fileCt; ++i) {
-        struct LrImgCtl *  const thisEntryP = &imgCtl[i];
+        LrImgCtl *         const thisEntryP = &imgCtl[i];
         const struct pam * const inpamP     = &inpam[i];
 
         switch (justification) {  /* Determine top padding */
@@ -730,7 +730,7 @@ createLrImgCtlArray(const struct pam *  const inpam,  /* array */
                 pnm_scaletuplerow(&inpam[i], thisEntryP->cachedRow,
                                   thisEntryP->cachedRow, outpamP->maxval);
                 thisEntryP->background = pnm_backgroundtuplerow(
-                    thisEntryP->cachedRow, &inpam[i], outpamP);
+                    outpamP, thisEntryP->cachedRow);
                 break;
             case PAD_BLACK:
                 thisEntryP->cachedRow = NULL;
@@ -755,10 +755,10 @@ destroyLrImgCtlArray(LrImgCtl *   const imgCtl,  /* array */
     unsigned int i;
 
     for (i = 0; i < fileCt; ++i) {
-        struct LrImgCtl * const thisEntryP = &imgCtl[i];
+        LrImgCtl * const thisEntryP = &imgCtl[i];
 
-        pnm_freepamtuple(thisEntry->background);
-        pnm_freepamrow(thisEntry->.cachedRow);
+        pnm_freepamtuple(thisEntryP->background);
+        pnm_freepamrow(thisEntryP->cachedRow);
     }
 
     free(imgCtl);
@@ -787,8 +787,8 @@ concatenateLeftRightGen(const struct pam *  const outpamP,
         unsigned int i;
 
         for (i = 0; i < fileCt; ++i) {
-            LrImgCtl *   const thisEntryP = &imgCtl[i];
-            struct pam * const inpamP     = &inpam[i];
+            LrImgCtl *   const thisEntryP   = &imgCtl[i];
+            const struct pam * const inpamP = &inpam[i];
 
             if ((row == 0 && thisEntryP->padtop > 0) ||
                 row == thisEntryP->padtop + inpamP->height) {
@@ -828,6 +828,8 @@ concatenateLeftRightGen(const struct pam *  const outpamP,
         */
         pnm_writepamrow(outpamP, outrow);
     }
+    destroyLrImgCtlArray(imgCtl, fileCt);
+
     pnm_freepamrow(outrow);
 }
 
@@ -920,6 +922,8 @@ concatenateTopBottomGen(const struct pam *  const outpamP,
     }
 
     for (i = 0; i < fileCt; ++i, backgroundPrev = background) {
+        const struct pam * const inpamP = &inpam[i];
+
         unsigned int row;
         unsigned int startRow;
         bool backChanged;
@@ -934,7 +938,7 @@ concatenateTopBottomGen(const struct pam *  const outpamP,
             out = &newTuplerow[0];
         } else {
             unsigned int const padLeft =
-                leftPadAmount(outpamP, &inpam[i], justification);
+                leftPadAmount(outpamP, inpamP, justification);
 
             if (padColorMethod == PAD_AUTO) {
                 /* Determine background color */
@@ -942,13 +946,13 @@ concatenateTopBottomGen(const struct pam *  const outpamP,
                 startRow = 1;
                 out = &newTuplerow[padLeft];
 
-                pnm_readpamrow(&inpam[i], out);
+                pnm_readpamrow(inpamP, out);
 
-                padPlanesRow(planePadMethod, &inpam[i], out, outpamP);
+                padPlanesRow(planePadMethod, inpamP, out, outpamP);
 
-                pnm_scaletuplerow(&inpam[i], out, out, outpamP->maxval);
+                pnm_scaletuplerow(inpamP, out, out, outpamP->maxval);
 
-                background = pnm_backgroundtuplerow(out, &inpam[i], outpamP);
+                background = pnm_backgroundtuplerow(outpamP, out);
 
                 backChanged =
                     i == 0 ||
@@ -970,7 +974,7 @@ concatenateTopBottomGen(const struct pam *  const outpamP,
             pnm_writepamrow(outpamP, newTuplerow);
 
         for (row = startRow; row < inpamP->height; ++row) {
-            pnm_readpamrow(&inpam[i], out);
+            pnm_readpamrow(inpamP, out);
 
             pnm_writepamrow(outpamP, newTuplerow);
         }