Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
be95c67d
Commit
be95c67d
authored
Oct 16, 2016
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up #includes.
parent
44a6be1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
mini_al.h
mini_al.h
+12
-6
No files found.
mini_al.h
View file @
be95c67d
...
...
@@ -461,12 +461,12 @@ mal_uint32 mal_get_sample_size_in_bytes(mal_format format);
#endif
#ifdef MAL_POSIX
#include <pthread.h>
#include <unistd.h>
#endif
#if !defined(NDEBUG)
#include <assert.h>
#
include <errno.h>
#
endif
#ifdef _WIN32
#ifdef _WIN64
...
...
@@ -557,17 +557,23 @@ typedef mal_thread_result (MAL_THREADCALL * mal_thread_entry_proc)(void* pData);
#endif
#endif
// Return Values:
// 0: Success
// 22: EINVAL
// 34: ERANGE
//
// Not using symbolic constants for errors because I want to avoid #including errno.h
static
int
mal_strncpy_s
(
char
*
dst
,
size_t
dstSizeInBytes
,
const
char
*
src
,
size_t
count
)
{
if
(
dst
==
0
)
{
return
EINVAL
;
return
22
;
}
if
(
dstSizeInBytes
==
0
)
{
return
EINVAL
;
return
22
;
}
if
(
src
==
0
)
{
dst
[
0
]
=
'\0'
;
return
EINVAL
;
return
22
;
}
size_t
maxcount
=
count
;
...
...
@@ -586,7 +592,7 @@ static int mal_strncpy_s(char* dst, size_t dstSizeInBytes, const char* src, size
}
dst
[
0
]
=
'\0'
;
return
ERANGE
;
return
34
;
}
// Thanks to good old Bit Twiddling Hacks for this one: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
...
...
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