Got rid of the last bit of intmax_t. Now to verify everything.
This commit is contained in:
parent
4524ffce5e
commit
fa4542f217
|
@ -13,8 +13,8 @@ struct uiArea {
|
||||||
BOOL scrolling;
|
BOOL scrolling;
|
||||||
int scrollWidth;
|
int scrollWidth;
|
||||||
int scrollHeight;
|
int scrollHeight;
|
||||||
intmax_t hscrollpos;
|
int hscrollpos;
|
||||||
intmax_t vscrollpos;
|
int vscrollpos;
|
||||||
int hwheelCarry;
|
int hwheelCarry;
|
||||||
int vwheelCarry;
|
int vwheelCarry;
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
// - error if these are called without scrollbars?
|
// - error if these are called without scrollbars?
|
||||||
|
|
||||||
struct scrollParams {
|
struct scrollParams {
|
||||||
intmax_t *pos;
|
int *pos;
|
||||||
intmax_t pagesize;
|
int pagesize;
|
||||||
intmax_t length;
|
int length;
|
||||||
int *wheelCarry;
|
int *wheelCarry;
|
||||||
UINT wheelSPIAction;
|
UINT wheelSPIAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void scrollto(uiArea *a, int which, struct scrollParams *p, intmax_t pos)
|
static void scrollto(uiArea *a, int which, struct scrollParams *p, int pos)
|
||||||
{
|
{
|
||||||
SCROLLINFO si;
|
SCROLLINFO si;
|
||||||
|
|
||||||
|
@ -48,14 +48,14 @@ static void scrollto(uiArea *a, int which, struct scrollParams *p, intmax_t pos)
|
||||||
SetScrollInfo(a->hwnd, which, &si, TRUE);
|
SetScrollInfo(a->hwnd, which, &si, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scrollby(uiArea *a, int which, struct scrollParams *p, intmax_t delta)
|
static void scrollby(uiArea *a, int which, struct scrollParams *p, int delta)
|
||||||
{
|
{
|
||||||
scrollto(a, which, p, *(p->pos) + delta);
|
scrollto(a, which, p, *(p->pos) + delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scroll(uiArea *a, int which, struct scrollParams *p, WPARAM wParam, LPARAM lParam)
|
static void scroll(uiArea *a, int which, struct scrollParams *p, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
intmax_t pos;
|
int pos;
|
||||||
SCROLLINFO si;
|
SCROLLINFO si;
|
||||||
|
|
||||||
pos = *(p->pos);
|
pos = *(p->pos);
|
||||||
|
@ -134,7 +134,7 @@ static void hscrollParams(uiArea *a, struct scrollParams *p)
|
||||||
p->wheelSPIAction = SPI_GETWHEELSCROLLCHARS;
|
p->wheelSPIAction = SPI_GETWHEELSCROLLCHARS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hscrollto(uiArea *a, intmax_t pos)
|
static void hscrollto(uiArea *a, int pos)
|
||||||
{
|
{
|
||||||
struct scrollParams p;
|
struct scrollParams p;
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ static void hscrollto(uiArea *a, intmax_t pos)
|
||||||
scrollto(a, SB_HORZ, &p, pos);
|
scrollto(a, SB_HORZ, &p, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hscrollby(uiArea *a, intmax_t delta)
|
static void hscrollby(uiArea *a, int delta)
|
||||||
{
|
{
|
||||||
struct scrollParams p;
|
struct scrollParams p;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ static void vscrollParams(uiArea *a, struct scrollParams *p)
|
||||||
p->wheelSPIAction = SPI_GETWHEELSCROLLLINES;
|
p->wheelSPIAction = SPI_GETWHEELSCROLLLINES;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vscrollto(uiArea *a, intmax_t pos)
|
static void vscrollto(uiArea *a, int pos)
|
||||||
{
|
{
|
||||||
struct scrollParams p;
|
struct scrollParams p;
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ static void vscrollto(uiArea *a, intmax_t pos)
|
||||||
scrollto(a, SB_VERT, &p, pos);
|
scrollto(a, SB_VERT, &p, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vscrollby(uiArea *a, intmax_t delta)
|
static void vscrollby(uiArea *a, int delta)
|
||||||
{
|
{
|
||||||
struct scrollParams p;
|
struct scrollParams p;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
// - uiRadioButtons
|
// - uiRadioButtons
|
||||||
// - uiSpinbox
|
// - uiSpinbox
|
||||||
// - uiTab
|
// - uiTab
|
||||||
|
// - uiForm
|
||||||
|
// - uiGrid
|
||||||
|
|
||||||
struct containerInit {
|
struct containerInit {
|
||||||
uiWindowsControl *c;
|
uiWindowsControl *c;
|
||||||
|
@ -23,7 +25,7 @@ static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
|
||||||
struct containerInit *init;
|
struct containerInit *init;
|
||||||
uiWindowsControl *c;
|
uiWindowsControl *c;
|
||||||
void (*onResize)(uiWindowsControl *);
|
void (*onResize)(uiWindowsControl *);
|
||||||
intmax_t minwid, minht;
|
int minwid, minht;
|
||||||
LRESULT lResult;
|
LRESULT lResult;
|
||||||
|
|
||||||
if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
|
if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// LONGTERM migrate to std::vector
|
// LONGTERM migrate to std::vector
|
||||||
|
|
||||||
static uiMenu **menus = NULL;
|
static uiMenu **menus = NULL;
|
||||||
static uintmax_t len = 0;
|
static size_t len = 0;
|
||||||
static uintmax_t cap = 0;
|
static size_t cap = 0;
|
||||||
static BOOL menusFinalized = FALSE;
|
static BOOL menusFinalized = FALSE;
|
||||||
static WORD curID = 100; // start somewhere safe
|
static WORD curID = 100; // start somewhere safe
|
||||||
static BOOL hasQuit = FALSE;
|
static BOOL hasQuit = FALSE;
|
||||||
|
@ -15,8 +15,8 @@ static BOOL hasAbout = FALSE;
|
||||||
struct uiMenu {
|
struct uiMenu {
|
||||||
WCHAR *name;
|
WCHAR *name;
|
||||||
uiMenuItem **items;
|
uiMenuItem **items;
|
||||||
uintmax_t len;
|
size_t len;
|
||||||
uintmax_t cap;
|
size_t cap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct uiMenuItem {
|
struct uiMenuItem {
|
||||||
|
@ -28,8 +28,8 @@ struct uiMenuItem {
|
||||||
BOOL disabled; // template for new instances; kept in sync with everything else
|
BOOL disabled; // template for new instances; kept in sync with everything else
|
||||||
BOOL checked;
|
BOOL checked;
|
||||||
HMENU *hmenus;
|
HMENU *hmenus;
|
||||||
uintmax_t len;
|
size_t len;
|
||||||
uintmax_t cap;
|
size_t cap;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -45,7 +45,7 @@ enum {
|
||||||
|
|
||||||
static void sync(uiMenuItem *item)
|
static void sync(uiMenuItem *item)
|
||||||
{
|
{
|
||||||
uintmax_t i;
|
size_t i;
|
||||||
MENUITEMINFOW mi;
|
MENUITEMINFOW mi;
|
||||||
|
|
||||||
ZeroMemory(&mi, sizeof (MENUITEMINFOW));
|
ZeroMemory(&mi, sizeof (MENUITEMINFOW));
|
||||||
|
@ -246,7 +246,7 @@ static void appendMenuItem(HMENU menu, uiMenuItem *item)
|
||||||
static HMENU makeMenu(uiMenu *m)
|
static HMENU makeMenu(uiMenu *m)
|
||||||
{
|
{
|
||||||
HMENU menu;
|
HMENU menu;
|
||||||
uintmax_t i;
|
size_t i;
|
||||||
|
|
||||||
menu = CreatePopupMenu();
|
menu = CreatePopupMenu();
|
||||||
if (menu == NULL)
|
if (menu == NULL)
|
||||||
|
@ -260,7 +260,7 @@ HMENU makeMenubar(void)
|
||||||
{
|
{
|
||||||
HMENU menubar;
|
HMENU menubar;
|
||||||
HMENU menu;
|
HMENU menu;
|
||||||
uintmax_t i;
|
size_t i;
|
||||||
|
|
||||||
menusFinalized = TRUE;
|
menusFinalized = TRUE;
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ void runMenuEvent(WORD id, uiWindow *w)
|
||||||
{
|
{
|
||||||
uiMenu *m;
|
uiMenu *m;
|
||||||
uiMenuItem *item;
|
uiMenuItem *item;
|
||||||
uintmax_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
// this isn't optimal, but it works, and it should be just fine for most cases
|
// this isn't optimal, but it works, and it should be just fine for most cases
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
@ -306,9 +306,9 @@ found:
|
||||||
|
|
||||||
static void freeMenu(uiMenu *m, HMENU submenu)
|
static void freeMenu(uiMenu *m, HMENU submenu)
|
||||||
{
|
{
|
||||||
uintmax_t i;
|
size_t i;
|
||||||
uiMenuItem *item;
|
uiMenuItem *item;
|
||||||
uintmax_t j;
|
size_t j;
|
||||||
|
|
||||||
for (i = 0; i < m->len; i++) {
|
for (i = 0; i < m->len; i++) {
|
||||||
item = m->items[i];
|
item = m->items[i];
|
||||||
|
@ -326,7 +326,7 @@ static void freeMenu(uiMenu *m, HMENU submenu)
|
||||||
|
|
||||||
void freeMenubar(HMENU menubar)
|
void freeMenubar(HMENU menubar)
|
||||||
{
|
{
|
||||||
uintmax_t i;
|
size_t i;
|
||||||
MENUITEMINFOW mi;
|
MENUITEMINFOW mi;
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
@ -344,7 +344,7 @@ void uninitMenus(void)
|
||||||
{
|
{
|
||||||
uiMenu *m;
|
uiMenu *m;
|
||||||
uiMenuItem *item;
|
uiMenuItem *item;
|
||||||
uintmax_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
m = menus[i];
|
m = menus[i];
|
||||||
|
|
Loading…
Reference in New Issue