Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.1.0 #33

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d538c99
Added an initial typedef for the method callback.
shalecraig Feb 2, 2014
8dd6673
affinity -> offset.
shalecraig Feb 2, 2014
f620f4f
Update the accel.c file with this.
shalecraig Feb 2, 2014
bd5d0f9
Synchronized the sample code
shalecraig Feb 2, 2014
072f9ab
Notes, and parameters.
shalecraig Feb 2, 2014
df2cd2f
Added a threshold variable.
shalecraig Feb 16, 2014
f30683b
Added callback to the accel_state struct
shalecraig Mar 8, 2014
9b76246
Started writing tests that the callback is being called.
shalecraig Mar 10, 2014
ed4adfd
Added Macros to allow me to shim anonymous classes into c.
shalecraig Mar 10, 2014
132c652
Added currently failing test to motivate myself to work.
shalecraig Mar 10, 2014
67c087f
Updated the testutil header to work.
shalecraig Mar 13, 2014
750d15f
Added basic tests for callback evaluation.
shalecraig Mar 13, 2014
80dbd54
Ignore dSYM file(s)
shalecraig Mar 13, 2014
ab15ee7
Cleaned up some formatting in accel_test
shalecraig Mar 13, 2014
afc6514
Fixing incorrect comment
shalecraig Mar 13, 2014
97f1ca0
Added clang-format file
shalecraig Mar 14, 2014
4c434de
Formatted all code. WOOHOO!
shalecraig Mar 14, 2014
d1a1f90
Updated accel library version for sample-accel
shalecraig Mar 15, 2014
963c8bb
Formatted simple-accelerometer.c
shalecraig Mar 18, 2014
072e6af
I believe I have setup the commit setup script
shalecraig Mar 18, 2014
76db08c
Cleaned up the clang-format commit hook
shalecraig Mar 18, 2014
12eb59d
added comment describing the change
shalecraig Mar 18, 2014
1d21e3e
Updated the version to be 1.1.0a
shalecraig Mar 19, 2014
ab8bbd1
Make sure the version is updated correctly
shalecraig Mar 19, 2014
9e403c3
Moved tests around
shalecraig Mar 19, 2014
aaa920a
Initial cleanup
shalecraig Mar 21, 2014
c77c5d5
Updated with new and improved makefile
shalecraig Mar 21, 2014
a018544
Updated bin folder to makefile
shalecraig Mar 21, 2014
40837b1
makefiles are no longer in the test env.
shalecraig Mar 21, 2014
73130a3
Build all the branches!
shalecraig Mar 21, 2014
94d3934
Somehow, this wasn't working.
shalecraig Mar 21, 2014
df4b8a7
Build at every commit.
shalecraig Mar 21, 2014
fb56833
Everything that builds a bin requires it.
shalecraig Mar 21, 2014
062bc1e
Merge pull request #43 from shalecraig/shale/1.1.0/build-on-commit
shalecraig Mar 21, 2014
9bd1194
Removed useless constant modifier
shalecraig Mar 21, 2014
c2c2549
Updated the accel to be more conformant to c spec
shalecraig Mar 21, 2014
1ab4e6d
Added C and CXX formalized arguments.
shalecraig Mar 21, 2014
18d99ad
Modified the way we require pthreads
shalecraig Mar 21, 2014
1808738
Merge pull request #44 from shalecraig/shale/1.1.0/arguments-be-crazy
shalecraig Mar 21, 2014
10e654c
Updated the demo code.
shalecraig Mar 21, 2014
11bed50
Added commit hook to keep the demo in sync
shalecraig Mar 21, 2014
fc54eb5
Implemented accel_reset_affinities_for_gesture
shalecraig Mar 22, 2014
158cf20
Upped the unit test to be more comprehensive
shalecraig Mar 22, 2014
d3c070b
Always clean the directory when committing
shalecraig Mar 22, 2014
e274b86
Merge pull request #45 from shalecraig/shale/1.1.0/accel_reset_affini…
shalecraig Mar 22, 2014
302c85f
Merge pull request #46 from shalecraig/shale/1.1.0/make-always-clean-…
shalecraig Mar 22, 2014
3b6cd77
Added tests that were somehow missed in transition
shalecraig Mar 22, 2014
d5d3873
Removed introduced TODO
shalecraig Mar 22, 2014
9568e8f
Added uint32_t import
shalecraig Mar 22, 2014
9b08277
void_null -> VOID_NULL
shalecraig Mar 22, 2014
d0f545c
Cleaned up TODOs
shalecraig Mar 22, 2014
9e508f2
Added the test file.
shalecraig Mar 22, 2014
589ffff
Merge pull request #47 from shalecraig/shale/1.1.0/add_more_tests
shalecraig Mar 23, 2014
05f6fbf
Started initial work on the moving_avg_ticker
shalecraig Mar 23, 2014
4c82c3b
Fixed changes, 1.1.0 should be at a good state.
shalecraig Mar 24, 2014
fa4276d
Makefile now has more Flags, more PHONY
shalecraig Mar 24, 2014
0da9bf0
Removed lock file.
shalecraig Mar 24, 2014
0c436d6
Ignore lock files
shalecraig Mar 24, 2014
71f18bd
Merge pull request #54 from shalecraig/shale/1.1.0/remove-lockfile
shalecraig Mar 24, 2014
a5ced11
Merge pull request #53 from shalecraig/shale/1.1.0/makefile-cleanup
shalecraig Mar 24, 2014
b676dc3
Check against #define, not a inline number.
shalecraig Mar 24, 2014
0b597a9
Added a ton of warnings, so everything is known.
shalecraig Mar 24, 2014
549aab2
Alpha is a float, as it should be
shalecraig Mar 25, 2014
9aa0efb
Added brackets to some types, and braces to others
shalecraig Mar 25, 2014
4729152
Wow, I cleaned up types everywhere.
shalecraig Mar 25, 2014
5544f45
Hmm, this can go too.
shalecraig Mar 25, 2014
cbc1a17
Updated a number of types so pebble build works
shalecraig Mar 25, 2014
368a791
Remove useless definiition
shalecraig Mar 25, 2014
eccae35
Made offsets explicitly int32_t
shalecraig Mar 25, 2014
3e5a2f1
Threshold is now unsigned.
shalecraig Mar 25, 2014
ef502c0
Made tons of types more explicitly signed/sized
shalecraig Mar 27, 2014
79ad48c
updated phony targets
shalecraig Mar 27, 2014
147b371
Added more compilation flags
shalecraig Mar 27, 2014
ca4a0d0
Merge pull request #55 from shalecraig/shale/1.1.0/makefile-pedantic++
shalecraig Mar 27, 2014
8405f3d
Specific types are best types:
shalecraig Mar 27, 2014
b158047
Moved the last few major types over to explicit types:
shalecraig Mar 27, 2014
de6e7df
Merge pull request #56 from shalecraig/shale/1.1.0/finish-changing-types
shalecraig Mar 27, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AlwaysBreakTemplateDeclarations: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerBinding: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
SpaceBeforeParens: ControlStatements
...

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
*.exe
*.out
*.app

# Built folder(s)
bin
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ compiler:
- gcc
- clang
script:
- cd test/
- make run
branches:
only:
- master
- 1.8.7
notifications:
recipients:
- [email protected]
Expand Down
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# TODO: update this.
.PHONY = default echo/objects echo/sources list tests run bin clean

SOURCES_C = $(wildcard src/*.c)
TEST_CC = $(wildcard test/*.cc)

_SOURCES_OBJECTS_TMP = ${SOURCES_C:.c=.o}
_TEST_OBJECTS_TMP = ${TEST_CC:.cc=.o}
SOURCES_OBJECTS = $(subst src,bin,$(_SOURCES_OBJECTS_TMP))
TEST_OBJECTS = $(subst test,bin,$(_TEST_OBJECTS_TMP))

EXEC = tests

# removed: -Wl,-z,relro -Wl,-z,now
C_ARGS = -ansi -DIS_NOT_PEBBLE -DRELEASE -ffunction-sections -fno-exceptions -fPIC -fPIE -fstack-protector-all -fstrict-overflow -fvisibility=hidden -g -m64 -Os -pedantic-errors -pipe -std=c99 -W -Wall -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcomment -Wconversion -Wdeprecated -Werror -Wextra -Wfloat-equal -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k -Winit-self -Wmissing-include-dirs -Wmultichar -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wreturn-type -Wsign-compare -Wstack-protector -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wtrigraphs -Wundef -Wuninitialized -Wuninitialized -Wunused-function -Wunused-label -Wunused-macros -Wunused-parameter -Wvariadic-macros -Wwrite-strings -Wlong-long -Wincompatible-pointer-types -Wtype-limits -Werror=type-limits
# removed: -lpthread, -Wl,-z,relro -Wl,-z,now -Wsign-conversion
CXX_ARGS = -DIS_NOT_PEBBLE -fno-exceptions -fPIC -fstack-protector -fvisibility=hidden -g -lpthread -m64 -O3 -pipe -W -Wall -Wextra -Wextra-tokens -Wconversion -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmultichar -Wno-deprecated -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wpointer-arith -Wreturn-type -Wsign-compare -Wuninitialized -Wcast-qual -Wsign-compare -Wno-sign-conversion -Wno-conversion

default:
@make all

echo/objects:
@echo ${SOURCES_OBJECTS}
@echo ${TEST_OBJECTS}

echo/sources:
@echo ${SOURCES_C}
@echo ${TEST_CC}

list:
@echo $(.PHONY)

tests: bin/tests

bin/tests: ${SOURCES_OBJECTS} ${TEST_OBJECTS} bin/libgtest.a bin
clang++ -Ilib/gtest-1.7.0/include ${SOURCES_OBJECTS} ${TEST_OBJECTS} bin/libgtest.a -lpthread -o bin/tests

run: tests
./bin/tests

bin/%.o : src/%.c bin
clang ${C_ARGS} -c $< -o $@

bin/%.o : test/%.cc bin
clang++ -Ilib/gtest-1.7.0/include ${CXX_ARGS} -c $< -o $@

bin/libgtest.a: bin
clang++ -Ilib/gtest-1.7.0/include -Ilib/gtest-1.7.0 -c lib/gtest-1.7.0/src/gtest-all.cc -o bin/libgtest.a

bin:
mkdir -p bin

clean:
rm -rf bin
8 changes: 8 additions & 0 deletions s/hooks/auto/pre-commit/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

pushd $(git rev-parse --show-toplevel || echo ".")

make clean run

popd
11 changes: 11 additions & 0 deletions s/hooks/auto/pre-commit/clang-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

pushd $(git rev-parse --show-toplevel || echo ".")

# Use clang-format on changed files.
git diff --name-only --cached | \
grep -E '\.(h|c|cc|cpp)' | \
xargs clang-format -i

popd
8 changes: 8 additions & 0 deletions s/hooks/auto/pre-commit/update_demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

pushd $(git rev-parse --show-toplevel || echo ".")

cp src/* sample/simple-accelerometer/src/

popd
21 changes: 21 additions & 0 deletions s/hooks/config/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

echo -------------------------------------------
echo -- Pre-commit --
echo -------------------------------------------

# Goto root.
pushd $(git rev-parse --show-toplevel || echo ".")

# Make the individual scripts runnable
find . -path ./s/hooks/auto/pre-commit/\*.sh -exec chmod +x "{}" \;

find . -path ./s/hooks/auto/pre-commit/\*.sh -exec sh "{}" \;

popd

echo -------------------------------------------
echo -- Done! --
echo -------------------------------------------
19 changes: 19 additions & 0 deletions s/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e

echo -------------------------------------------
echo -- Git Hooks --
echo -------------------------------------------

# Goto root.
pushd $(git rev-parse --show-toplevel || echo ".")

find . -path ./s/hooks/config/\* -exec chmod +x "{}" \;
find . -path ./s/hooks/config/\* -exec cp "{}" .git/hooks \;

popd

echo -------------------------------------------
echo -- Done! --
echo -------------------------------------------
2 changes: 2 additions & 0 deletions sample/simple-accelerometer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

# Ignore build generated files
build

.lock*
8 changes: 0 additions & 8 deletions sample/simple-accelerometer/.lock-waf_linux2_build

This file was deleted.

Loading