Mercurial > dwindows
comparison os2/dw.c @ 8:e22584460709
Switched allocating the box structs with calloc instead of malloc so
that the flags (and perhaps other structs) would be initialized to 0.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 03 Jul 2001 14:04:12 +0000 |
parents | 005fa766e8c2 |
children | 3383ed751a7e |
comparison
equal
deleted
inserted
replaced
7:005fa766e8c2 | 8:e22584460709 |
---|---|
2440 * flStyle: Style flags, see the PM reference. | 2440 * flStyle: Style flags, see the PM reference. |
2441 */ | 2441 */ |
2442 HWND dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) | 2442 HWND dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) |
2443 { | 2443 { |
2444 HWND hwndclient = 0, hwndframe; | 2444 HWND hwndclient = 0, hwndframe; |
2445 Box *newbox = malloc(sizeof(Box)); | 2445 Box *newbox = calloc(1, sizeof(Box)); |
2446 PFNWP *blah = malloc(sizeof(PFNWP)); | 2446 PFNWP *blah = malloc(sizeof(PFNWP)); |
2447 | 2447 |
2448 newbox->pad = 0; | 2448 newbox->pad = 0; |
2449 newbox->type = BOXVERT; | 2449 newbox->type = BOXVERT; |
2450 newbox->count = 0; | 2450 newbox->count = 0; |
2465 * type: Either BOXVERT (vertical) or BOXHORZ (horizontal). | 2465 * type: Either BOXVERT (vertical) or BOXHORZ (horizontal). |
2466 * pad: Number of pixels to pad around the box. | 2466 * pad: Number of pixels to pad around the box. |
2467 */ | 2467 */ |
2468 HWND dw_box_new(int type, int pad) | 2468 HWND dw_box_new(int type, int pad) |
2469 { | 2469 { |
2470 Box *newbox = malloc(sizeof(Box)); | 2470 Box *newbox = calloc(1, sizeof(Box)); |
2471 HWND hwndframe; | 2471 HWND hwndframe; |
2472 | 2472 |
2473 newbox->pad = pad; | 2473 newbox->pad = pad; |
2474 newbox->type = type; | 2474 newbox->type = type; |
2475 newbox->count = 0; | 2475 newbox->count = 0; |
2499 * pad: Number of pixels to pad around the box. | 2499 * pad: Number of pixels to pad around the box. |
2500 * title: Text to be displayined in the group outline. | 2500 * title: Text to be displayined in the group outline. |
2501 */ | 2501 */ |
2502 HWND dw_groupbox_new(int type, int pad, char *title) | 2502 HWND dw_groupbox_new(int type, int pad, char *title) |
2503 { | 2503 { |
2504 Box *newbox = malloc(sizeof(Box)); | 2504 Box *newbox = calloc(1, sizeof(Box)); |
2505 HWND hwndframe; | 2505 HWND hwndframe; |
2506 | 2506 |
2507 newbox->pad = pad; | 2507 newbox->pad = pad; |
2508 newbox->type = type; | 2508 newbox->type = type; |
2509 newbox->count = 0; | 2509 newbox->count = 0; |