Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hassan Albahri
apk-tools
Commits
e00f5ea7
Commit
e00f5ea7
authored
15 years ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
build: optimize with -O2 by default
also make the array code more explicit to have gcc optimizer happy.
parent
f1985b03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Make.rules
+1
-1
1 addition, 1 deletion
Make.rules
src/apk_defines.h
+3
-2
3 additions, 2 deletions
src/apk_defines.h
with
4 additions
and
3 deletions
Make.rules
+
1
−
1
View file @
e00f5ea7
...
...
@@ -67,7 +67,7 @@ LD := $(CROSS_COMPILE)ld
INSTALL := install
INSTALLDIR := $(INSTALL) -d
CFLAGS ?= -g
CFLAGS ?= -g
-O2
CFLAGS_ALL := -Werror -Wall -Wstrict-prototypes -D_GNU_SOURCE -std=gnu99
CFLAGS_ALL += $(CFLAGS)
...
...
This diff is collapsed.
Click to expand it.
src/apk_defines.h
+
3
−
2
View file @
e00f5ea7
...
...
@@ -83,12 +83,13 @@ typedef void (*apk_progress_cb)(void *cb_ctx, size_t);
{ \
struct array_type_name *tmp; \
int oldnum = a ? a->num : 0; \
int diff = size - oldnum; \
tmp = (struct array_type_name *) \
realloc(a, sizeof(struct array_type_name) + \
size * sizeof(elem_type_name)); \
if (
size > oldnum)
\
if (
diff > 0)
\
memset(&tmp->item[oldnum], 0, \
(size - oldnum)
* sizeof(a->item[0])); \
diff
* sizeof(a->item[0]));
\
tmp->num = size; \
return tmp; \
} \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment