From b1c076416cf916119abbb6281318a648e4e8ab77 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sun, 4 Jan 2026 14:57:29 +0200 Subject: [PATCH] Remove magic numbers --- Laptop/email.cpp | 8 +++++--- Laptop/email.h | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Laptop/email.cpp b/Laptop/email.cpp index 9262e032..10f1b274 100644 --- a/Laptop/email.cpp +++ b/Laptop/email.cpp @@ -187,9 +187,11 @@ UINT32 guiEmailWarning; #define SUBJECT_LINE_Y VIEWER_Y+42 #define SUBJECT_LINE_WIDTH 278-47 - +//max number of lines can be shown in an opened email messagebox +#define MAX_EMAIL_LINES 20 // maximum size of a email message page, so not to overrun the bottom of the screen -#define MAX_EMAIL_MESSAGE_PAGE_SIZE ( GetFontHeight( MESSAGE_FONT ) + MESSAGE_GAP ) * 20 +#define MAX_EMAIL_MESSAGE_PAGE_SIZE ( GetFontHeight( MESSAGE_FONT ) + MESSAGE_GAP ) * MAX_EMAIL_LINES + enum{ PREVIOUS_BUTTON=0, NEXT_BUTTON, @@ -5475,7 +5477,7 @@ UINT32 cnt; void PreProcessEmail( EmailPtr pMail ) { RecordPtr pTempRecord, pCurrentRecord, pLastRecord , pTempList; - CHAR16 pString[ 512 ]; + CHAR16 pString[MAIL_STRING_SIZE]; INT32 iCounter = 0, iHeight = 0, iOffSet = 0; BOOLEAN fGoingOffCurrentPage = FALSE; INT32 iYPositionOnPage = 0; diff --git a/Laptop/email.h b/Laptop/email.h index 25e075ca..100d8739 100644 --- a/Laptop/email.h +++ b/Laptop/email.h @@ -5,8 +5,7 @@ #include "soldier profile type.h" // defines -#define MAX_EMAIL_LINES 10 //max number of lines can be shown in a message -#define MAX_MESSAGES_PAGE 18 // max number of messages per page +#define MAX_MESSAGES_PAGE 18 // max number of emails per page in inbox //---ja25 ub #ifdef JA2UB