fix warnings and sigsegv
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
65115b53d6
commit
276a9eeec5
2 changed files with 2 additions and 4 deletions
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
static int wcreate(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwLabel lab = malloc(sizeof(*lab));
|
MwLabel lab = malloc(sizeof(*lab));
|
||||||
|
memset(lab, 0, sizeof(*lab));
|
||||||
|
|
||||||
lab->segment = NULL;
|
|
||||||
handle->internal = lab;
|
handle->internal = lab;
|
||||||
|
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
@ -321,7 +321,6 @@ static void draw_normal(MwWidget handle) {
|
||||||
int align;
|
int align;
|
||||||
const char* str = MwGetText(handle, MwNtext);
|
const char* str = MwGetText(handle, MwNtext);
|
||||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||||
int l_one = MwGetInteger(handle, MwNlength) - (MwGetInteger(handle, MwNlength) % 2);
|
|
||||||
|
|
||||||
if(str == NULL) str = "";
|
if(str == NULL) str = "";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,14 +107,13 @@ static void layout_widget(MwWidget handle, MwWidget child) {
|
||||||
int bw = (MwGetInteger(handle, MwNhasBorder) ? MwDefaultBorderWidth(handle) : 0) + MwGetInteger(handle, MwNpadding);
|
int bw = (MwGetInteger(handle, MwNhasBorder) ? MwDefaultBorderWidth(handle) : 0) + MwGetInteger(handle, MwNpadding);
|
||||||
int m = MwGetInteger(handle, MwNmargin);
|
int m = MwGetInteger(handle, MwNmargin);
|
||||||
int n, x, y, cw = 0, ch = 0;
|
int n, x, y, cw = 0, ch = 0;
|
||||||
int gcs, grs;
|
int gcs;
|
||||||
intkv_t* kv = NULL;
|
intkv_t* kv = NULL;
|
||||||
|
|
||||||
LAYOUT_BEGIN;
|
LAYOUT_BEGIN;
|
||||||
LAYOUT_END(1);
|
LAYOUT_END(1);
|
||||||
|
|
||||||
gcs = (n + c - 1) / c;
|
gcs = (n + c - 1) / c;
|
||||||
grs = n % c;
|
|
||||||
cw = (MwGetInteger(handle, MwNwidth) - bw * 2 - (m * (c - 1))) / c;
|
cw = (MwGetInteger(handle, MwNwidth) - bw * 2 - (m * (c - 1))) / c;
|
||||||
ch = (MwGetInteger(handle, MwNheight) - m * (gcs - 1) - bw * 2) / gcs;
|
ch = (MwGetInteger(handle, MwNheight) - m * (gcs - 1) - bw * 2) / gcs;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue