Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0a92e106
Commit
0a92e106
authored
Dec 07, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Remove the RTFAlloc() wrapper around heap_alloc().
parent
4210cafc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
35 deletions
+23
-35
reader.c
dlls/riched20/reader.c
+22
-34
rtf.h
dlls/riched20/rtf.h
+1
-1
No files found.
dlls/riched20/reader.c
View file @
0a92e106
...
...
@@ -76,18 +76,6 @@ static void RTFPutCodePageChar(RTF_Info *info, int c);
/* ---------------------------------------------------------------------- */
/*
* Memory allocation routines
*/
/*
* Return pointer to block of size bytes, or NULL if there's
* not enough memory available.
*/
#define RTFAlloc(size) heap_alloc(size)
#define RTFReAlloc(ptr, size) heap_realloc(ptr, size)
#define RTFFree(ptr) heap_free(ptr)
/*
* Saves a string on the heap and returns a pointer to it.
...
...
@@ -96,7 +84,7 @@ static inline char *RTFStrSave(const char *s)
{
char
*
p
;
p
=
RTFA
lloc
(
lstrlenA
(
s
)
+
1
);
p
=
heap_a
lloc
(
lstrlenA
(
s
)
+
1
);
if
(
p
==
NULL
)
return
NULL
;
return
lstrcpyA
(
p
,
s
);
...
...
@@ -143,14 +131,14 @@ RTFDestroyAttrs(RTF_Info *info)
while
(
info
->
fontList
)
{
fp
=
info
->
fontList
->
rtfNextFont
;
RTFF
ree
(
info
->
fontList
->
rtfFName
);
RTFF
ree
(
info
->
fontList
);
heap_f
ree
(
info
->
fontList
->
rtfFName
);
heap_f
ree
(
info
->
fontList
);
info
->
fontList
=
fp
;
}
while
(
info
->
colorList
)
{
cp
=
info
->
colorList
->
rtfNextColor
;
RTFF
ree
(
info
->
colorList
);
heap_f
ree
(
info
->
colorList
);
info
->
colorList
=
cp
;
}
while
(
info
->
styleList
)
...
...
@@ -160,12 +148,12 @@ RTFDestroyAttrs(RTF_Info *info)
while
(
eltList
)
{
ep
=
eltList
->
rtfNextSE
;
RTFF
ree
(
eltList
->
rtfSEText
);
RTFF
ree
(
eltList
);
heap_f
ree
(
eltList
->
rtfSEText
);
heap_f
ree
(
eltList
);
eltList
=
ep
;
}
RTFF
ree
(
info
->
styleList
->
rtfSName
);
RTFF
ree
(
info
->
styleList
);
heap_f
ree
(
info
->
styleList
->
rtfSName
);
heap_f
ree
(
info
->
styleList
);
info
->
styleList
=
sp
;
}
}
...
...
@@ -176,11 +164,11 @@ RTFDestroy(RTF_Info *info)
{
if
(
info
->
rtfTextBuf
)
{
RTFF
ree
(
info
->
rtfTextBuf
);
RTFF
ree
(
info
->
pushedTextBuf
);
heap_f
ree
(
info
->
rtfTextBuf
);
heap_f
ree
(
info
->
pushedTextBuf
);
}
RTFDestroyAttrs
(
info
);
RTFF
ree
(
info
->
cpOutputBuffer
);
heap_f
ree
(
info
->
cpOutputBuffer
);
}
...
...
@@ -196,15 +184,15 @@ void RTFInit(RTF_Info *info)
if
(
info
->
rtfTextBuf
==
NULL
)
/* initialize the text buffers */
{
info
->
rtfTextBuf
=
RTFA
lloc
(
rtfBufSiz
);
info
->
pushedTextBuf
=
RTFA
lloc
(
rtfBufSiz
);
info
->
rtfTextBuf
=
heap_a
lloc
(
rtfBufSiz
);
info
->
pushedTextBuf
=
heap_a
lloc
(
rtfBufSiz
);
if
(
info
->
rtfTextBuf
==
NULL
||
info
->
pushedTextBuf
==
NULL
)
ERR
(
"Cannot allocate text buffers.
\n
"
);
info
->
rtfTextBuf
[
0
]
=
info
->
pushedTextBuf
[
0
]
=
'\0'
;
}
RTFF
ree
(
info
->
inputName
);
RTFF
ree
(
info
->
outputName
);
heap_f
ree
(
info
->
inputName
);
heap_f
ree
(
info
->
outputName
);
info
->
inputName
=
info
->
outputName
=
NULL
;
for
(
i
=
0
;
i
<
rtfMaxClass
;
i
++
)
...
...
@@ -245,7 +233,7 @@ void RTFInit(RTF_Info *info)
if
(
!
info
->
cpOutputBuffer
)
{
info
->
dwMaxCPOutputCount
=
0x1000
;
info
->
cpOutputBuffer
=
RTFA
lloc
(
info
->
dwMaxCPOutputCount
);
info
->
cpOutputBuffer
=
heap_a
lloc
(
info
->
dwMaxCPOutputCount
);
}
}
...
...
@@ -2300,9 +2288,9 @@ void LookupInit(void)
rp
->
rtfKHash
=
Hash
(
rp
->
rtfKStr
);
index
=
rp
->
rtfKHash
%
(
RTF_KEY_COUNT
*
2
);
if
(
!
rtfHashTable
[
index
].
count
)
rtfHashTable
[
index
].
value
=
RTFA
lloc
(
sizeof
(
RTFKey
*
));
rtfHashTable
[
index
].
value
=
heap_a
lloc
(
sizeof
(
RTFKey
*
));
else
rtfHashTable
[
index
].
value
=
RTFReA
lloc
(
rtfHashTable
[
index
].
value
,
sizeof
(
RTFKey
*
)
*
(
rtfHashTable
[
index
].
count
+
1
));
rtfHashTable
[
index
].
value
=
heap_rea
lloc
(
rtfHashTable
[
index
].
value
,
sizeof
(
RTFKey
*
)
*
(
rtfHashTable
[
index
].
count
+
1
));
rtfHashTable
[
index
].
value
[
rtfHashTable
[
index
].
count
++
]
=
rp
;
}
}
...
...
@@ -2313,7 +2301,7 @@ void LookupCleanup(void)
for
(
i
=
0
;
i
<
RTF_KEY_COUNT
*
2
;
i
++
)
{
RTFF
ree
(
rtfHashTable
[
i
].
value
);
heap_f
ree
(
rtfHashTable
[
i
].
value
);
rtfHashTable
[
i
].
value
=
NULL
;
rtfHashTable
[
i
].
count
=
0
;
}
...
...
@@ -2682,7 +2670,7 @@ static void
RTFFlushCPOutputBuffer
(
RTF_Info
*
info
)
{
int
bufferMax
=
info
->
dwCPOutputCount
*
2
*
sizeof
(
WCHAR
);
WCHAR
*
buffer
=
RTFA
lloc
(
bufferMax
);
WCHAR
*
buffer
=
heap_a
lloc
(
bufferMax
);
int
length
;
length
=
MultiByteToWideChar
(
info
->
codePage
,
0
,
info
->
cpOutputBuffer
,
...
...
@@ -2690,7 +2678,7 @@ RTFFlushCPOutputBuffer(RTF_Info *info)
info
->
dwCPOutputCount
=
0
;
RTFPutUnicodeString
(
info
,
buffer
,
length
);
RTFF
ree
((
char
*
)
buffer
);
heap_f
ree
((
char
*
)
buffer
);
}
void
...
...
@@ -2719,7 +2707,7 @@ RTFPutCodePageChar(RTF_Info *info, int c)
if
(
info
->
dwCPOutputCount
>=
info
->
dwMaxCPOutputCount
)
{
info
->
dwMaxCPOutputCount
*=
2
;
info
->
cpOutputBuffer
=
RTFReA
lloc
(
info
->
cpOutputBuffer
,
info
->
dwMaxCPOutputCount
);
info
->
cpOutputBuffer
=
heap_rea
lloc
(
info
->
cpOutputBuffer
,
info
->
dwMaxCPOutputCount
);
}
info
->
cpOutputBuffer
[
info
->
dwCPOutputCount
++
]
=
c
;
}
dlls/riched20/rtf.h
View file @
0a92e106
...
...
@@ -1005,7 +1005,7 @@ struct RTFStyleElt
* if no memory available.
*/
# define New(t) (
(t *) RTFAlloc ((int)
sizeof (t)))
# define New(t) (
heap_alloc (
sizeof (t)))
/* Parser stack size */
...
...
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