From b26354d1e7b49cf051b8e707b0477bddce443f77 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 13 Jun 2016 20:46:11 -0400 Subject: [PATCH] Started replacement of intmax_t and uintmax_t with int. --- darwin/box.m | 10 +++++----- ui.h | 2 +- unix/box.c | 2 +- windows/box.cpp | 27 +++++++++++++-------------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/darwin/box.m b/darwin/box.m index 8661d902..4b688e65 100644 --- a/darwin/box.m +++ b/darwin/box.m @@ -14,7 +14,7 @@ NSMutableArray *children; BOOL vertical; int padded; - uintmax_t nStretchy; + int nStretchy; NSLayoutConstraint *first; NSMutableArray *inBetweens; @@ -36,7 +36,7 @@ - (CGFloat)paddingAmount; - (void)establishOurConstraints; - (void)append:(uiControl *)c stretchy:(int)stretchy; -- (void)delete:(uintmax_t)n; +- (void)delete:(int)n; - (int)isPadded; - (void)setPadded:(int)p; - (BOOL)hugsTrailing; @@ -249,7 +249,7 @@ struct uiBox { { boxChild *bc; NSLayoutPriority priority; - uintmax_t oldnStretchy; + int oldnStretchy; bc = [boxChild new]; bc.c = c; @@ -285,7 +285,7 @@ struct uiBox { [bc release]; // we don't need the initial reference now } -- (void)delete:(uintmax_t)n +- (void)delete:(int)n { boxChild *bc; int stretchy; @@ -405,7 +405,7 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy) [b->view append:c stretchy:stretchy]; } -void uiBoxDelete(uiBox *b, uintmax_t n) +void uiBoxDelete(uiBox *b, int n) { [b->view delete:n]; } diff --git a/ui.h b/ui.h index 20d23eee..ee12efd4 100644 --- a/ui.h +++ b/ui.h @@ -113,7 +113,7 @@ _UI_EXTERN uiButton *uiNewButton(const char *text); typedef struct uiBox uiBox; #define uiBox(this) ((uiBox *) (this)) _UI_EXTERN void uiBoxAppend(uiBox *b, uiControl *child, int stretchy); -_UI_EXTERN void uiBoxDelete(uiBox *b, uintmax_t index); +_UI_EXTERN void uiBoxDelete(uiBox *b, int index); _UI_EXTERN int uiBoxPadded(uiBox *b); _UI_EXTERN void uiBoxSetPadded(uiBox *b, int padded); _UI_EXTERN uiBox *uiNewHorizontalBox(void); diff --git a/unix/box.c b/unix/box.c index 47efe278..23fb7f7c 100644 --- a/unix/box.c +++ b/unix/box.c @@ -88,7 +88,7 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy) g_array_append_val(b->controls, bc); } -void uiBoxDelete(uiBox *b, uintmax_t index) +void uiBoxDelete(uiBox *b, int index) { struct boxChild *bc; GtkWidget *widget; diff --git a/windows/box.cpp b/windows/box.cpp index 01413ebe..d87f73e2 100644 --- a/windows/box.cpp +++ b/windows/box.cpp @@ -4,8 +4,8 @@ struct boxChild { uiControl *c; int stretchy; - intmax_t width; - intmax_t height; + int width; + int height; }; struct uiBox { @@ -31,12 +31,12 @@ static void boxPadding(uiBox *b, int *xpadding, int *ypadding) static void boxRelayout(uiBox *b) { RECT r; - intmax_t x, y, width, height; + int x, y, width, height; int xpadding, ypadding; - uintmax_t nStretchy; - intmax_t stretchywid, stretchyht; - uintmax_t i; - intmax_t minimumWidth, minimumHeight; + int nStretchy; + int stretchywid, stretchyht; + int i; + int minimumWidth, minimumHeight; uiWindowsSizing *d; if (b->controls->size() == 0) @@ -149,16 +149,16 @@ static void uiBoxSyncEnableState(uiWindowsControl *c, int enabled) uiWindowsControlDefaultSetParentHWND(uiBox) -static void uiBoxMinimumSize(uiWindowsControl *c, intmax_t *width, intmax_t *height) +static void uiBoxMinimumSize(uiWindowsControl *c, int *width, int *height) { uiBox *b = uiBox(c); int xpadding, ypadding; - uintmax_t nStretchy; + int nStretchy; // these two contain the largest minimum width and height of all stretchy controls in the box // all stretchy controls will use this value to determine the final minimum size - intmax_t maxStretchyWidth, maxStretchyHeight; - uintmax_t i; - intmax_t minimumWidth, minimumHeight; + int maxStretchyWidth, maxStretchyHeight; + int i; + int minimumWidth, minimumHeight; uiWindowsSizing sizing; *width = 0; @@ -230,7 +230,6 @@ static void boxArrangeChildren(uiBox *b) { LONG_PTR controlID; HWND insertAfter; - uintmax_t i; controlID = 100; insertAfter = NULL; @@ -251,7 +250,7 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy) uiWindowsControlMinimumSizeChanged(uiWindowsControl(b)); } -void uiBoxDelete(uiBox *b, uintmax_t index) +void uiBoxDelete(uiBox *b, int index) { uiControl *c;