Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
8867bd55
Commit
8867bd55
authored
Oct 13, 2008
by
Eric Wong
Committed by
Max Kellermann
Oct 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_item: avoid wasting space when struct is unpackable
Not all compilers support struct packing, and those that don't shouldn't be punished for it.
parent
c641aabe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
tag.h
src/tag.h
+1
-1
tag_pool.c
src/tag_pool.c
+3
-1
No files found.
src/tag.h
View file @
8867bd55
...
...
@@ -44,7 +44,7 @@ extern const char *mpdTagItemKeys[];
struct
tag_item
{
enum
tag_type
type
;
char
value
[
1
];
char
value
[
sizeof
(
long
)
];
}
mpd_packed
;
struct
tag
{
...
...
src/tag_pool.c
View file @
8867bd55
...
...
@@ -69,7 +69,9 @@ static struct slot *slot_alloc(struct slot *next,
enum
tag_type
type
,
const
char
*
value
,
int
length
)
{
struct
slot
*
slot
=
xmalloc
(
sizeof
(
*
slot
)
+
length
);
struct
slot
*
slot
;
slot
=
xmalloc
(
sizeof
(
*
slot
)
-
sizeof
(
slot
->
item
.
value
)
+
length
+
1
);
slot
->
next
=
next
;
slot
->
ref
=
1
;
slot
->
item
.
type
=
type
;
...
...
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