Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fba0897e
Commit
fba0897e
authored
Aug 26, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: xmalloc shouldn't initialize to zero, do that explicitly where needed.
parent
1916cb1e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
7 deletions
+11
-7
genres.c
tools/wrc/genres.c
+1
-0
newstruc.c
tools/wrc/newstruc.c
+3
-0
newstruc.h
tools/wrc/newstruc.h
+3
-1
parser.y
tools/wrc/parser.y
+3
-0
utils.c
tools/wrc/utils.c
+1
-6
No files found.
tools/wrc/genres.c
View file @
fba0897e
...
...
@@ -51,6 +51,7 @@ res_t *new_res(void)
r
=
(
res_t
*
)
xmalloc
(
sizeof
(
res_t
));
r
->
allocsize
=
RES_BLOCKSIZE
;
r
->
size
=
0
;
r
->
dataidx
=
0
;
r
->
data
=
(
char
*
)
xmalloc
(
RES_BLOCKSIZE
);
return
r
;
}
...
...
tools/wrc/newstruc.c
View file @
fba0897e
...
...
@@ -76,6 +76,7 @@ __NEW_STRUCT_FUNC(ani_any)
resource_t
*
new_resource
(
enum
res_e
t
,
void
*
res
,
int
memopt
,
language_t
*
lan
)
{
resource_t
*
r
=
(
resource_t
*
)
xmalloc
(
sizeof
(
resource_t
));
memset
(
r
,
0
,
sizeof
(
*
r
)
);
r
->
type
=
t
;
r
->
res
.
overlay
=
res
;
r
->
memopt
=
memopt
;
...
...
@@ -1145,6 +1146,7 @@ stringtable_t *new_stringtable(lvc_t *lvc)
{
stringtable_t
*
stt
=
(
stringtable_t
*
)
xmalloc
(
sizeof
(
stringtable_t
));
memset
(
stt
,
0
,
sizeof
(
*
stt
)
);
if
(
lvc
)
stt
->
lvc
=
*
lvc
;
...
...
@@ -1154,6 +1156,7 @@ stringtable_t *new_stringtable(lvc_t *lvc)
toolbar_t
*
new_toolbar
(
int
button_width
,
int
button_height
,
toolbar_item_t
*
items
,
int
nitems
)
{
toolbar_t
*
tb
=
(
toolbar_t
*
)
xmalloc
(
sizeof
(
toolbar_t
));
memset
(
tb
,
0
,
sizeof
(
*
tb
)
);
tb
->
button_width
=
button_width
;
tb
->
button_height
=
button_height
;
tb
->
nitems
=
nitems
;
...
...
tools/wrc/newstruc.h
View file @
fba0897e
...
...
@@ -26,7 +26,9 @@
#define __NEW_STRUCT_FUNC(p) \
p##_t *new_##p(void)\
{\
return (p##_t *)xmalloc(sizeof(p##_t));\
p##_t * ret = xmalloc(sizeof(*ret)); \
memset( ret, 0, sizeof(*ret) ); \
return ret; \
}
#define __NEW_STRUCT_PROTO(p) p##_t *new_##p(void)
...
...
tools/wrc/parser.y
View file @
fba0897e
...
...
@@ -2286,6 +2286,7 @@ static event_t *add_string_event(string_t *key, int id, int flags, event_t *prev
static
itemex_opt_t
*
new_itemex_opt
(
int
id
,
int
type
,
int
state
,
int
helpid
)
{
itemex_opt_t
*opt
=
(itemex_opt_t
*)xmalloc(sizeof(itemex_opt_t));
memset(
opt,
0,
sizeof(*opt)
);
opt->id
=
id;
opt->type
=
type;
opt->state
=
state;
...
...
@@ -2602,6 +2603,7 @@ static resource_t *build_stt_resources(stringtable_t *stthead)
{
newstt
=
new_stringtable(&stt->lvc);
newstt->entries
=
(stt_entry_t
*)xmalloc(16
*
sizeof(stt_entry_t));
memset(
newstt->entries,
0,
16
*
sizeof(stt_entry_t)
);
newstt->nentries
=
16;
newstt->idbase
=
stt->entries[i].id
&
~0xf;
for(j
=
0;
j
<
16
&&
i
<
stt->nentries;
j++)
...
...
@@ -2823,6 +2825,7 @@ static resource_t *build_fontdirs(resource_t *tail)
/* Copy space */
lanfnt
=
xmalloc
(
nfnt
*
sizeof
(*
lanfnt
));
memset
(
lanfnt
,
0
,
nfnt
*
sizeof
(*
lanfnt
));
/* Get all fonts covered by fontdirs */
for
(
i
=
0
;
i
<
nfnd
;
i
++)
...
...
tools/wrc/utils.c
View file @
fba0897e
...
...
@@ -168,12 +168,7 @@ void *xmalloc(size_t size)
{
error
(
"Virtual memory exhausted.
\n
"
);
}
/*
* We set it to 0.
* This is *paramount* because we depend on it
* just about everywhere in the rest of the code.
*/
memset
(
res
,
0
,
size
);
memset
(
res
,
0x55
,
size
);
return
res
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment