shithub: choc

Download patch

ref: 95dc2af73c4314cbdc09095f7aacd18499ff5d94
parent: c0bd4b7fe994820266af16ed44e368cc6e21389f
author: Simon Howard <fraggle@soulsphere.org>
date: Sun Jul 10 15:16:24 EDT 2016

diskicon: Use *saved_background for sizeof().

We need to use sizeof(*saved_background) when calculating the size of
the buffer. Fix this and also reflow text to keep within 80 column
limit. Thanks to edward-san for noticing this.

--- a/src/v_diskicon.c
+++ b/src/v_diskicon.c
@@ -67,12 +67,14 @@
     patch_t *disk;
 
     // Allocate a complete temporary screen where we'll draw the patch.
-    tmpscreen = Z_Malloc(SCREENWIDTH * SCREENHEIGHT * sizeof(*tmpscreen), PU_STATIC, NULL);
+    tmpscreen = Z_Malloc(SCREENWIDTH * SCREENHEIGHT * sizeof(*tmpscreen),
+                         PU_STATIC, NULL);
     memset(tmpscreen, 0, SCREENWIDTH * SCREENHEIGHT * sizeof(*tmpscreen));
     V_UseBuffer(tmpscreen);
 
     // Buffer where we'll save the disk data.
-    disk_data = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H * sizeof(*disk_data), PU_STATIC, NULL);
+    disk_data = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H * sizeof(*disk_data),
+                         PU_STATIC, NULL);
 
     // Draw the patch and save the result to disk_data.
     disk = W_CacheLumpName(disk_lump, PU_STATIC);
@@ -91,8 +93,9 @@
     loading_disk_xoffs = xoffs;
     loading_disk_yoffs = yoffs;
 
-    saved_background = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H * sizeof(saved_background), PU_STATIC,
-                                NULL);
+    saved_background = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H
+                                 * sizeof(*saved_background),
+                                PU_STATIC, NULL);
     SaveDiskData(lump_name, xoffs, yoffs);
 }