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

TheCount's "Cleanup and bugfixes", merge-able #5

Merged
merged 24 commits into from
Jan 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9e6f675
simpler sml_transport_read method
juriglx Jun 7, 2012
1f18d1e
size_t is unsigned
Jul 11, 2012
910a312
added newline to error msg
Jul 11, 2012
90e3e75
Fixed endianness bug in sml_number_init
dapaulid Aug 7, 2012
133ee5e
Fixed endianness bug in sml_number_init - revised
dapaulid Aug 7, 2012
57992d7
Ignore dpkg-buildpackage stuff
TheCount Dec 5, 2012
fef8683
Properly resolve library dependencies
TheCount Dec 5, 2012
766367f
Removed undefined behaviour due to reserved identifier names
TheCount Dec 5, 2012
bf2cc16
Fixed free() of uninitialised pointer
TheCount Dec 5, 2012
ba05ec8
Ignore editor files
TheCount Dec 5, 2012
e53f8b1
Typo
TheCount Dec 6, 2012
c4d2a1f
Freeing macros matching initialisation macros
TheCount Dec 6, 2012
5a60196
Fixed bad aliasing, unchecked malloc() return value and statement wit…
TheCount Dec 6, 2012
70d1038
Null pointers must be initialised explicitly because their internal r…
TheCount Dec 6, 2012
5e222d9
Clean up properly in test cases
TheCount Dec 6, 2012
7cdfdc7
Fixed signed comparison bug
TheCount Dec 7, 2012
f28fde1
Use puts for non-formatted output.
TheCount Dec 7, 2012
c4f2702
Choosing correct iteration type
TheCount Dec 7, 2012
54898ce
Use size_t for cursor position (possible ABI breaking change)
TheCount Dec 7, 2012
cb05145
Use safe conversions instead of dangerous function pointer casts
TheCount Dec 17, 2012
76b17ad
Updating Unity
TheCount Dec 5, 2012
152dbf1
Defining inline functions with static linkage
TheCount Jan 17, 2013
f5b3c9d
Enable more warnings regarding standards complicance
TheCount Jan 17, 2013
bd33967
fix merge conflicts: prefer TheCount's version over HEAD due to lack …
r00t- Jan 7, 2015
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Debian Packaging
/.pc/
/debian/files
/debian/libsml1/
/debian/libsml-dev/
/debian/*.debhelper*
/debian/*.substvars

# Binaries
/test/test
Expand All @@ -19,3 +24,6 @@
*.la
*.a

# Editor files
*~
*.swp
4 changes: 2 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
UNAME := $(shell uname)
CFLAGS += -I../sml/include/ -g -Wall
CFLAGS += -I../sml/include/ -g -std=c99 -Wall -Wextra -pedantic
OBJS = sml_server.o
LIBSML = ../sml/lib/libsml.a

Expand All @@ -8,7 +8,7 @@ LIBS = -luuid
endif

sml_server : $(OBJS) $(LIBSML)
$(CC) $(CFLAGS) $(OBJS) $(LIBS) $(LIBSML) -o sml_server
$(CC) $(CFLAGS) $(OBJS) $(LIBS) $(LIBSML) -o sml_server $(LIBS)

%.o : %.c
$(CC) $(CFLAGS) -c $^ -o $@
Expand Down
4 changes: 2 additions & 2 deletions sml/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
UNAME := $(shell uname)
CFLAGS += -I./include/ -fPIC -fno-stack-protector -g -Wall
CFLAGS += -I./include/ -fPIC -fno-stack-protector -g -std=c99 -Wall -Wextra -pedantic

# Available Flags:
# _NO_UUID_LIB - compile without uuid lib
# SML_NO_UUID_LIB - compile without uuid lib

ifeq ($(UNAME), Linux)
LIBS=-luuid
Expand Down
7 changes: 3 additions & 4 deletions sml/include/sml/sml_attention_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.


#ifndef _SML_ATTENTION_RESPONSE_H_
#define _SML_ATTENTION_RESPONSE_H_
#ifndef SML_ATTENTION_RESPONSE_H_
#define SML_ATTENTION_RESPONSE_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -46,5 +45,5 @@ void sml_attention_response_free(sml_attention_response *msg);
#endif


#endif /* _SML_ATTENTION_RESPONSE_H_ */
#endif /* SML_ATTENTION_RESPONSE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_boolean.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_BOOLEAN_H_
#define _SML_BOOLEAN_H_
#ifndef SML_BOOLEAN_H_
#define SML_BOOLEAN_H_

#define SML_BOOLEAN_TRUE 0xFF
#define SML_BOOLEAN_FALSE 0x00
Expand All @@ -40,5 +40,5 @@ void sml_boolean_free(sml_boolean *b);
#endif


#endif /* _SML_BOOLEAN_H_ */
#endif /* SML_BOOLEAN_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_close_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_CLOSE_REQUEST_H_
#define _SML_CLOSE_REQUEST_H_
#ifndef SML_CLOSE_REQUEST_H_
#define SML_CLOSE_REQUEST_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand All @@ -40,5 +40,5 @@ void sml_close_request_free(sml_close_request *msg);
#endif


#endif /* _SML_CLOSE_REQUEST_H_ */
#endif /* SML_CLOSE_REQUEST_H_ */

7 changes: 3 additions & 4 deletions sml/include/sml/sml_close_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.


#ifndef _SML_CLOSE_RESPONSE_H_
#define _SML_CLOSE_RESPONSE_H_
#ifndef SML_CLOSE_RESPONSE_H_
#define SML_CLOSE_RESPONSE_H_

#include "sml_close_request.h"

Expand All @@ -38,5 +37,5 @@ void sml_close_response_free(sml_close_response *msg);
#endif


#endif /* _SML_CLOSE_RESPONSE_H_ */
#endif /* SML_CLOSE_RESPONSE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_crc16.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_CRC16_H_
#define _SML_CRC16_H_
#ifndef SML_CRC16_H_
#define SML_CRC16_H_

#include "sml_shared.h"

Expand All @@ -33,5 +33,5 @@ u16 sml_crc16_calculate(unsigned char *cp, int len) ;
#endif


#endif /* _SML_CRC16_H_ */
#endif /* SML_CRC16_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_FILE_H_
#define _SML_FILE_H_
#ifndef SML_FILE_H_
#define SML_FILE_H_

#include "sml_message.h"
#include "sml_shared.h"
Expand Down Expand Up @@ -47,5 +47,5 @@ void sml_file_print(sml_file *file);
#endif


#endif /* _SML_FILE_H_ */
#endif /* SML_FILE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_list_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_LIST_REQUEST_H_
#define _SML_GET_LIST_REQUEST_H_
#ifndef SML_GET_LIST_REQUEST_H_
#define SML_GET_LIST_REQUEST_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -46,5 +46,5 @@ void sml_get_list_request_free(sml_get_list_request *msg);
#endif


#endif /* _SML_GET_LIST_REQUEST_H_ */
#endif /* SML_GET_LIST_REQUEST_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_list_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_LIST_RESPONSE_H_
#define _SML_GET_LIST_RESPONSE_H_
#ifndef SML_GET_LIST_RESPONSE_H_
#define SML_GET_LIST_RESPONSE_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -48,5 +48,5 @@ void sml_get_list_response_free(sml_get_list_response *msg);
#endif


#endif /* _SML_GET_LIST_RESPONSE_H_ */
#endif /* SML_GET_LIST_RESPONSE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_proc_parameter_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROC_PARAMETER_REQUEST_H_
#define _SML_GET_PROC_PARAMETER_REQUEST_H_
#ifndef SML_GET_PROC_PARAMETER_REQUEST_H_
#define SML_GET_PROC_PARAMETER_REQUEST_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -45,5 +45,5 @@ void sml_get_proc_parameter_request_free(sml_get_proc_parameter_request *msg);
#endif


#endif /* _SML_GET_PROC_PARAMETER_REQUEST_H_ */
#endif /* SML_GET_PROC_PARAMETER_REQUEST_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_proc_parameter_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROC_PARAMETER_RESPONSE_H_
#define _SML_GET_PROC_PARAMETER_RESPONSE_H_
#ifndef SML_GET_PROC_PARAMETER_RESPONSE_H_
#define SML_GET_PROC_PARAMETER_RESPONSE_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand All @@ -43,5 +43,5 @@ void sml_get_proc_parameter_response_free(sml_get_proc_parameter_response *msg);
#endif


#endif /* _SML_GET_PROC_PARAMETER_RESPONSE_H_ */
#endif /* SML_GET_PROC_PARAMETER_RESPONSE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_profile_list_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROFILE_LIST_REQUEST_H_
#define _SML_GET_PROFILE_LIST_REQUEST_H_
#ifndef SML_GET_PROFILE_LIST_REQUEST_H_
#define SML_GET_PROFILE_LIST_REQUEST_H_

#include "sml_get_profile_pack_request.h"

Expand All @@ -38,5 +38,5 @@ typedef sml_get_profile_pack_request sml_get_profile_list_request;
#endif


#endif /* _SML_GET_PROFILE_LIST_REQUEST_H_ */
#endif /* SML_GET_PROFILE_LIST_REQUEST_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_profile_list_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROFILE_LIST_RESPONSE_H_
#define _SML_GET_PROFILE_LIST_RESPONSE_H_
#ifndef SML_GET_PROFILE_LIST_RESPONSE_H_
#define SML_GET_PROFILE_LIST_RESPONSE_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -51,5 +51,5 @@ void sml_get_profile_list_response_free(sml_get_profile_list_response *msg);
#endif


#endif /* _SML_GET_PROFILE_LIST_RESPONSE_H_ */
#endif /* SML_GET_PROFILE_LIST_RESPONSE_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_profile_pack_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROFILE_PACK_REQUEST_H_
#define _SML_GET_PROFILE_PACK_REQUEST_H_
#ifndef SML_GET_PROFILE_PACK_REQUEST_H_
#define SML_GET_PROFILE_PACK_REQUEST_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -64,5 +64,5 @@ void sml_get_profile_pack_request_free(sml_get_profile_pack_request *msg);
#endif


#endif /* _SML_GET_PROFILE_PACK_REQUEST_H_ */
#endif /* SML_GET_PROFILE_PACK_REQUEST_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_get_profile_pack_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_GET_PROFILE_PACK_RESPONSE_H_
#define _SML_GET_PROFILE_PACK_RESPONSE_H_
#ifndef SML_GET_PROFILE_PACK_RESPONSE_H_
#define SML_GET_PROFILE_PACK_RESPONSE_H_

#include "sml_shared.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -84,5 +84,5 @@ void sml_value_entry_free(sml_value_entry *entry);
#endif


#endif /* _SML_GET_PROFILE_PACK_RESPONSE_H_ */
#endif /* SML_GET_PROFILE_PACK_RESPONSE_H_ */

7 changes: 3 additions & 4 deletions sml/include/sml/sml_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.


#ifndef _SML_LIST_H_
#define _SML_LIST_H_
#ifndef SML_LIST_H_
#define SML_LIST_H_

#include "sml_time.h"
#include "sml_octet_string.h"
Expand Down Expand Up @@ -66,5 +65,5 @@ void sml_list_free(sml_list *list);
#endif


#endif /* _SML_LIST_H_ */
#endif /* SML_LIST_H_ */

7 changes: 3 additions & 4 deletions sml/include/sml/sml_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.


#ifndef _SML_MESSAGE_H_
#define _SML_MESSAGE_H_
#ifndef SML_MESSAGE_H_
#define SML_MESSAGE_H_

#include <stdlib.h>
#include "sml_octet_string.h"
Expand Down Expand Up @@ -92,5 +91,5 @@ void sml_message_body_write(sml_message_body *message_body, sml_buffer *buf);
#endif


#endif /* _SML_MESSAGE_H_ */
#endif /* SML_MESSAGE_H_ */

16 changes: 12 additions & 4 deletions sml/include/sml/sml_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.


#ifndef _SML_NUMBER_H_
#define _SML_NUMBER_H_
#ifndef SML_NUMBER_H_
#define SML_NUMBER_H_

#include "sml_shared.h"

Expand Down Expand Up @@ -64,6 +63,15 @@ void sml_number_free(void *np);
#define sml_i32_write(n, buf) sml_number_write(n, SML_TYPE_INTEGER, SML_TYPE_NUMBER_32, buf)
#define sml_i64_write(n, buf) sml_number_write(n, SML_TYPE_INTEGER, SML_TYPE_NUMBER_64, buf)

#define sml_u8_free( n ) sml_number_free( n )
#define sml_u16_free( n ) sml_number_free( n )
#define sml_u32_free( n ) sml_number_free( n )
#define sml_u64_free( n ) sml_number_free( n )
#define sml_i8_free( n ) sml_number_free( n )
#define sml_i16_free( n ) sml_number_free( n )
#define sml_i32_free( n ) sml_number_free( n )
#define sml_i64_free( n ) sml_number_free( n )

typedef u8 sml_unit;
#define sml_unit_init(n) sml_u8_init(n)
#define sml_unit_parse(buf) sml_u8_parse(buf)
Expand All @@ -75,5 +83,5 @@ typedef u8 sml_unit;
#endif


#endif /* _SML_NUMBER_H_ */
#endif /* SML_NUMBER_H_ */

6 changes: 3 additions & 3 deletions sml/include/sml/sml_octet_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with libSML. If not, see <http://www.gnu.org/licenses/>.

#ifndef _SML_OCTET_STRING_H_
#define _SML_OCTET_STRING_H_
#ifndef SML_OCTET_STRING_H_
#define SML_OCTET_STRING_H_

#include <string.h>
#include "sml_shared.h"
Expand Down Expand Up @@ -52,5 +52,5 @@ typedef octet_string sml_signature;
#endif


#endif /* _SML_OCTET_STRING_H_ */
#endif /* SML_OCTET_STRING_H_ */

Loading