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
3687100c
Commit
3687100c
authored
Jan 31, 2002
by
Guy Albertelli
Committed by
Alexandre Julliard
Jan 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added NULL checks on all rectangle pointers.
parent
1e55094e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
rect.c
windows/rect.c
+10
-0
No files found.
windows/rect.c
View file @
3687100c
...
...
@@ -29,6 +29,7 @@ void WINAPI SetRect16( LPRECT16 rect, INT16 left, INT16 top,
BOOL
WINAPI
SetRect
(
LPRECT
rect
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
)
{
if
(
!
rect
)
return
FALSE
;
rect
->
left
=
left
;
rect
->
right
=
right
;
rect
->
top
=
top
;
...
...
@@ -51,6 +52,7 @@ void WINAPI SetRectEmpty16( LPRECT16 rect )
*/
BOOL
WINAPI
SetRectEmpty
(
LPRECT
rect
)
{
if
(
!
rect
)
return
FALSE
;
rect
->
left
=
rect
->
right
=
rect
->
top
=
rect
->
bottom
=
0
;
return
TRUE
;
}
...
...
@@ -96,6 +98,7 @@ BOOL16 WINAPI IsRectEmpty16( const RECT16 *rect )
*/
BOOL
WINAPI
IsRectEmpty
(
const
RECT
*
rect
)
{
if
(
!
rect
)
return
TRUE
;
return
((
rect
->
left
>=
rect
->
right
)
||
(
rect
->
top
>=
rect
->
bottom
));
}
...
...
@@ -115,6 +118,7 @@ BOOL16 WINAPI PtInRect16( const RECT16 *rect, POINT16 pt )
*/
BOOL
WINAPI
PtInRect
(
const
RECT
*
rect
,
POINT
pt
)
{
if
(
!
rect
)
return
FALSE
;
return
((
pt
.
x
>=
rect
->
left
)
&&
(
pt
.
x
<
rect
->
right
)
&&
(
pt
.
y
>=
rect
->
top
)
&&
(
pt
.
y
<
rect
->
bottom
));
}
...
...
@@ -137,6 +141,7 @@ void WINAPI OffsetRect16( LPRECT16 rect, INT16 x, INT16 y )
*/
BOOL
WINAPI
OffsetRect
(
LPRECT
rect
,
INT
x
,
INT
y
)
{
if
(
!
rect
)
return
FALSE
;
rect
->
left
+=
x
;
rect
->
right
+=
x
;
rect
->
top
+=
y
;
...
...
@@ -162,6 +167,7 @@ void WINAPI InflateRect16( LPRECT16 rect, INT16 x, INT16 y )
*/
BOOL
WINAPI
InflateRect
(
LPRECT
rect
,
INT
x
,
INT
y
)
{
if
(
!
rect
)
return
FALSE
;
rect
->
left
-=
x
;
rect
->
top
-=
y
;
rect
->
right
+=
x
;
...
...
@@ -197,6 +203,7 @@ BOOL16 WINAPI IntersectRect16( LPRECT16 dest, const RECT16 *src1,
BOOL
WINAPI
IntersectRect
(
LPRECT
dest
,
const
RECT
*
src1
,
const
RECT
*
src2
)
{
if
(
!
dest
||
!
src1
||
!
src2
)
return
FALSE
;
if
(
IsRectEmpty
(
src1
)
||
IsRectEmpty
(
src2
)
||
(
src1
->
left
>=
src2
->
right
)
||
(
src2
->
left
>=
src1
->
right
)
||
(
src1
->
top
>=
src2
->
bottom
)
||
(
src2
->
top
>=
src1
->
bottom
))
...
...
@@ -248,6 +255,7 @@ BOOL16 WINAPI UnionRect16( LPRECT16 dest, const RECT16 *src1,
BOOL
WINAPI
UnionRect
(
LPRECT
dest
,
const
RECT
*
src1
,
const
RECT
*
src2
)
{
if
(
!
dest
)
return
FALSE
;
if
(
IsRectEmpty
(
src1
))
{
if
(
IsRectEmpty
(
src2
))
...
...
@@ -287,6 +295,7 @@ BOOL16 WINAPI EqualRect16( const RECT16* rect1, const RECT16* rect2 )
*/
BOOL
WINAPI
EqualRect
(
const
RECT
*
rect1
,
const
RECT
*
rect2
)
{
if
(
!
rect1
||
!
rect2
)
return
FALSE
;
return
((
rect1
->
left
==
rect2
->
left
)
&&
(
rect1
->
right
==
rect2
->
right
)
&&
(
rect1
->
top
==
rect2
->
top
)
&&
(
rect1
->
bottom
==
rect2
->
bottom
));
}
...
...
@@ -336,6 +345,7 @@ BOOL WINAPI SubtractRect( LPRECT dest, const RECT *src1,
{
RECT
tmp
;
if
(
!
dest
)
return
FALSE
;
if
(
IsRectEmpty
(
src1
))
{
SetRectEmpty
(
dest
);
...
...
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