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
42a82726
Commit
42a82726
authored
Mar 21, 2018
by
Gijs Vermeulen
Committed by
Alexandre Julliard
Mar 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Introduce ARRAY_SIZE macro.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0aff523d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
api.c
dlls/avifil32/api.c
+6
-6
avifile.c
dlls/avifil32/avifile.c
+4
-4
avifile_private.h
dlls/avifil32/avifile_private.h
+2
-0
wavfile.c
dlls/avifil32/wavfile.c
+2
-2
No files found.
dlls/avifil32/api.c
View file @
42a82726
...
...
@@ -156,7 +156,7 @@ static BOOL AVIFILE_GetFileHandlerByExtension(LPCWSTR szFile, LPCLSID lpclsid)
CHAR
szRegKey
[
25
];
CHAR
szValue
[
100
];
LPWSTR
szExt
=
strrchrW
(
szFile
,
'.'
);
LONG
len
=
sizeof
(
szValue
)
/
sizeof
(
szValue
[
0
]
);
LONG
len
=
ARRAY_SIZE
(
szValue
);
if
(
szExt
==
NULL
)
return
FALSE
;
...
...
@@ -371,7 +371,7 @@ HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile, PAVISTREAM *ppavi,
/* Only the szName at the end is different */
memcpy
(
&
psiw
,
psi
,
sizeof
(
*
psi
)
-
sizeof
(
psi
->
szName
));
MultiByteToWideChar
(
CP_ACP
,
0
,
psi
->
szName
,
-
1
,
psiw
.
szName
,
sizeof
(
psiw
.
szName
)
/
sizeof
(
psiw
.
szName
[
0
]
));
ARRAY_SIZE
(
psiw
.
szName
));
return
IAVIFile_CreateStream
(
pfile
,
ppavi
,
&
psiw
);
}
...
...
@@ -1035,7 +1035,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
HeapFree
(
GetProcessHeap
(),
0
,
lp
);
return
AVIERR_ERROR
;
}
for
(
n
=
0
;
RegEnumKeyW
(
hKey
,
n
,
szFileExt
,
sizeof
(
szFileExt
)
/
sizeof
(
szFileExt
[
0
]
))
==
ERROR_SUCCESS
;
n
++
)
{
for
(
n
=
0
;
RegEnumKeyW
(
hKey
,
n
,
szFileExt
,
ARRAY_SIZE
(
szFileExt
))
==
ERROR_SUCCESS
;
n
++
)
{
WCHAR
clsidW
[
40
];
/* get CLSID to extension */
...
...
@@ -1300,7 +1300,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
}
else
{
LoadStringW
(
AVIFILE_hModule
,
IDS_UNCOMPRESSED
,
icinfo
.
szDescription
,
sizeof
(
icinfo
.
szDescription
)
/
sizeof
(
icinfo
.
szDescription
[
0
]
));
ARRAY_SIZE
(
icinfo
.
szDescription
));
lstrcatW
(
szFormat
,
icinfo
.
szDescription
);
}
}
else
if
(
sInfo
.
fccType
==
streamtypeAUDIO
)
{
...
...
@@ -2160,7 +2160,7 @@ HRESULT WINAPI EditStreamSetNameA(PAVISTREAM pstream, LPCSTR szName)
return
hres
;
memset
(
asia
.
szName
,
0
,
sizeof
(
asia
.
szName
));
lstrcpynA
(
asia
.
szName
,
szName
,
sizeof
(
asia
.
szName
)
/
sizeof
(
asia
.
szName
[
0
]
));
lstrcpynA
(
asia
.
szName
,
szName
,
ARRAY_SIZE
(
asia
.
szName
));
return
EditStreamSetInfoA
(
pstream
,
&
asia
,
sizeof
(
asia
));
}
...
...
@@ -2185,7 +2185,7 @@ HRESULT WINAPI EditStreamSetNameW(PAVISTREAM pstream, LPCWSTR szName)
return
hres
;
memset
(
asiw
.
szName
,
0
,
sizeof
(
asiw
.
szName
));
lstrcpynW
(
asiw
.
szName
,
szName
,
sizeof
(
asiw
.
szName
)
/
sizeof
(
asiw
.
szName
[
0
]
));
lstrcpynW
(
asiw
.
szName
,
szName
,
ARRAY_SIZE
(
asiw
.
szName
));
return
EditStreamSetInfoW
(
pstream
,
&
asiw
,
sizeof
(
asiw
));
}
...
...
dlls/avifil32/avifile.c
View file @
42a82726
...
...
@@ -1641,7 +1641,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
This
->
fInfo
.
dwWidth
=
MainAVIHdr
.
dwWidth
;
This
->
fInfo
.
dwHeight
=
MainAVIHdr
.
dwHeight
;
LoadStringW
(
AVIFILE_hModule
,
IDS_AVIFILETYPE
,
This
->
fInfo
.
szFileType
,
sizeof
(
This
->
fInfo
.
szFileType
)
/
sizeof
(
This
->
fInfo
.
szFileType
[
0
]
));
ARRAY_SIZE
(
This
->
fInfo
.
szFileType
));
/* go back to into header list */
if
(
mmioAscend
(
This
->
hmmio
,
&
ck
,
0
)
!=
S_OK
)
...
...
@@ -1751,9 +1751,9 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
/* generate description for stream like "filename.avi Type #n" */
if
(
streamHdr
.
fccType
==
streamtypeVIDEO
)
LoadStringW
(
AVIFILE_hModule
,
IDS_VIDEO
,
szType
,
sizeof
(
szType
)
/
sizeof
(
szType
[
0
]
));
LoadStringW
(
AVIFILE_hModule
,
IDS_VIDEO
,
szType
,
ARRAY_SIZE
(
szType
));
else
if
(
streamHdr
.
fccType
==
streamtypeAUDIO
)
LoadStringW
(
AVIFILE_hModule
,
IDS_AUDIO
,
szType
,
sizeof
(
szType
)
/
sizeof
(
szType
[
0
]
));
LoadStringW
(
AVIFILE_hModule
,
IDS_AUDIO
,
szType
,
ARRAY_SIZE
(
szType
));
else
wsprintfW
(
szType
,
streamTypeFmt
,
(
char
*
)
&
streamHdr
.
fccType
);
...
...
@@ -1784,7 +1784,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
}
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
pStream
->
sInfo
.
szName
,
sizeof
(
pStream
->
sInfo
.
szName
)
/
sizeof
(
pStream
->
sInfo
.
szName
[
0
]
));
ARRAY_SIZE
(
pStream
->
sInfo
.
szName
));
HeapFree
(
GetProcessHeap
(),
0
,
str
);
}
...
...
dlls/avifil32/avifile_private.h
View file @
42a82726
...
...
@@ -22,6 +22,8 @@
#include <windef.h>
#include <winuser.h>
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#ifndef MAX_AVISTREAMS
#define MAX_AVISTREAMS 8
#endif
...
...
dlls/avifil32/wavfile.c
View file @
42a82726
...
...
@@ -522,9 +522,9 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface, LPCOLESTR pszFile
memset
(
&
This
->
sInfo
,
0
,
sizeof
(
This
->
sInfo
));
LoadStringW
(
AVIFILE_hModule
,
IDS_WAVEFILETYPE
,
This
->
fInfo
.
szFileType
,
sizeof
(
This
->
fInfo
.
szFileType
)
/
sizeof
(
This
->
fInfo
.
szFileType
[
0
]
));
ARRAY_SIZE
(
This
->
fInfo
.
szFileType
));
if
(
LoadStringW
(
AVIFILE_hModule
,
IDS_WAVESTREAMFORMAT
,
wszStreamFmt
,
sizeof
(
wszStreamFmt
)
/
sizeof
(
wszStreamFmt
[
0
]
))
>
0
)
{
wszStreamFmt
,
ARRAY_SIZE
(
wszStreamFmt
))
>
0
)
{
wsprintfW
(
This
->
sInfo
.
szName
,
wszStreamFmt
,
AVIFILE_BasenameW
(
This
->
szFileName
));
}
...
...
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