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

Correct your spacing #359

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .coafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Default]

[markdown]
files = **/*.md
bears = SpaceConsistencyBear
default_actions = SpaceConsistencyBear: ApplyPatchAction
use_spaces = true

[c]
files = **/*.(c|h)
bears = SpaceConsistencyBear
default_actions = SpaceConsistencyBear: ApplyPatchAction
use_spaces = true
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y vde2 check libvdeplug2-dev libpcap-dev psmisc
- sudo pip install cpp-coveralls
- sudo pip install cpp-coveralls coala
- make clean
- rm -f *.gc*

install: make GCOV=1 && make units ARCH=faulty GCOV=1 && make test GCOV=1
language: c
script:
script:
- ./test/coverage.sh
after_success:
- coala-ci
after_success:
- coveralls --exclude test/ --exclude modules/ptsocket --exclude build --exclude modules/pico_dev_mock.c --exclude modules/pico_dev_null.c --exclude modules/pico_dev_pcap.c --exclude modules/pico_dev_tap_windows.c --exclude modules/pico_dev_tun.c --gcov-options='\-lp'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ picoTCP

---------------

Welcome to the one and only <font color=ff00f0>picoTCP repository</font>.
Welcome to the one and only <font color=ff00f0>picoTCP repository</font>.

picoTCP is a smalli-footprint, modular TCP/IP stack designed for embedded systems and the Internet of Things. It's actively being developed by *[Altran Intelligent Systems](http://intelligent-systems.altran.com/)*. Textual information about picoTCP, you can find on the [about page of our website](http://picotcp.com/about).

Expand All @@ -20,10 +20,10 @@ Wondering about picoTCP's code quality? Check [our TiCS score](http://tics.picot

Continuous integration

Jenkins Functional tests:
Jenkins Functional tests:
[![Jenkins autotest](http://jenkins.picotcp.com:8080/buildStatus/icon?job=picoTCP_Rel/PicoTCP_rel_autotest)](http://jenkins.picotcp.com:8080/job/picoTCP_Rel/job/PicoTCP_rel_autotest)

Jenkins Unit tests :
Jenkins Unit tests :
[![Jenkins unit tests](http://jenkins.picotcp.com:8080/buildStatus/icon?job=picoTCP_Rel/PicoTCP_rel_unit_tests)](http://jenkins.picotcp.com:8080/job/picoTCP_Rel/job/PicoTCP_rel_unit_tests)

Jenkins RFC compliance :
Expand Down
12 changes: 6 additions & 6 deletions include/arch/pico_esp8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
extern void *pvPortMalloc( size_t xWantedSize );
extern void vPortFree( void *pv );

#define pico_free vPortFree
#define pico_free vPortFree

static inline void *pico_zalloc(size_t size)
{
Expand All @@ -39,17 +39,17 @@ static inline void *pico_zalloc(size_t size)
extern volatile uint32_t esp_tick;

static inline pico_time PICO_TIME_MS(void) {
return (pico_time) esp_tick;
return (pico_time) esp_tick;
}

static inline pico_time PICO_TIME(void) {
return PICO_TIME_MS() / 1000;
return PICO_TIME_MS() / 1000;
}

static inline void PICO_IDLE(void) {
uint32_t now = esp_tick;
while (now == esp_tick)
;
uint32_t now = esp_tick;
while (now == esp_tick)
;
}

#endif
2 changes: 1 addition & 1 deletion include/pico_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct pico_socket {
struct pico_tree *MCASTListen;
#ifdef PICO_SUPPORT_IPV6
struct pico_tree *MCASTListen_ipv6;
#endif
#endif
#endif
uint16_t ev_pending;

Expand Down
2 changes: 1 addition & 1 deletion modules/pico_dev_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ static void auth_abort(struct pico_device_ppp *ppp)

static void auth_req(struct pico_device_ppp *ppp)
{
uint16_t ppp_usr_len = 0;
uint16_t ppp_usr_len = 0;
uint16_t ppp_pwd_len = 0;
uint8_t *req = NULL, *p;
struct pico_pap_hdr *hdr;
Expand Down
2 changes: 1 addition & 1 deletion modules/pico_dhcp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ uint8_t pico_dhcp_opt_paramlist(void *ptr)
{
struct pico_dhcp_opt *opt = (struct pico_dhcp_opt *)ptr;
uint8_t *param_code = &(opt->ext.param_list.code[0]);

/* option: parameter list */
opt->code = PICO_DHCP_OPT_PARAMLIST;
opt->len = PICO_DHCP_OPTLEN_PARAMLIST - PICO_DHCP_OPTLEN_HDR;
Expand Down
72 changes: 36 additions & 36 deletions modules/pico_dns_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pico_dns_check_namelen( uint16_t namelen )
*
* @param name Compressed name you want the calculate the strlen from
* @return Returns strlen of a compressed name, takes the first byte of compr-
* ession pointer into account but not the second byte, which acts
* like a trailing zero-byte
* ession pointer into account but not the second byte, which acts
* like a trailing zero-byte
* ****************************************************************************/
uint16_t
pico_dns_namelen_comp( char *name )
Expand Down Expand Up @@ -130,7 +130,7 @@ pico_dns_decompress_name( char *name, pico_dns_packet *packet )
* @param arpalen Will get filled with the length of the ARPA-suffix depending
* on the proto-parameter.
* @param proto The protocol to create a ARPA-suffix for. Can be either
* 'PICO_PROTO_IPV4' or 'PICO_PROTO_IPV6'
* 'PICO_PROTO_IPV4' or 'PICO_PROTO_IPV6'
* @return Returns the length of the reverse name
* ****************************************************************************/
static uint16_t
Expand Down Expand Up @@ -377,7 +377,7 @@ pico_dns_first_label_length( const char *url )

/* ****************************************************************************
* Mirrors a dotted IPv4-address string.
* f.e. 192.168.0.1 => 1.0.168.192
* f.e. 192.168.0.1 => 1.0.168.192
*
* @param ptr
* @return 0 on success, something else on failure.
Expand Down Expand Up @@ -435,7 +435,7 @@ dns_ptr_ip6_nibble_hi( uint8_t byte )

/* ****************************************************************************
* Convert an IPv6-address in string-format to a IPv6-address in nibble-format.
* Doesn't add a IPv6 ARPA-suffix though.
* Doesn't add a IPv6 ARPA-suffix though.
*
* @param ip IPv6-address stored as a string
* @param dst Destination to store IPv6-address in nibble-format
Expand Down Expand Up @@ -484,7 +484,7 @@ static uint16_t pico_dns_question_size( void *question )
* Deletes a single DNS Question.
*
* @param question Void-pointer to DNS Question. Can be used with pico_tree_-
* destroy.
* destroy.
* @return Returns 0 on success, something else on failure.
* ****************************************************************************/
int
Expand Down Expand Up @@ -539,16 +539,16 @@ pico_dns_question_fill_suffix( struct pico_dns_question_suffix *suf,
*
* @param qname Pointer-pointer to the name-member of the DNS-question
* @param url Name in URL format you want to convert to a name in DNS name
* format. When reverse resolving, only the IP, either IPV4 or
* IPV6, should be given in string format.
* f.e. => for IPv4: "192.168.2.1"
* => for IPv6: "2001:0db8:85a3:0042:1000:8a2e:0370:7334"
* format. When reverse resolving, only the IP, either IPV4 or
* IPV6, should be given in string format.
* f.e. => for IPv4: "192.168.2.1"
* => for IPv6: "2001:0db8:85a3:0042:1000:8a2e:0370:7334"
* @param qtype DNS type type of the DNS question to be.
* @param proto When reverse is true the reverse resolution name will be
* generated depending on the protocol. Can be either
* PICO_PROTO_IPV4 or PICO_PROTO_IPV6.
* generated depending on the protocol. Can be either
* PICO_PROTO_IPV4 or PICO_PROTO_IPV6.
* @param reverse When this is true a reverse resolution name will be generated
* from the URL.
* from the URL.
* @return The eventual length of the generated name, 0 on failure.
* ****************************************************************************/
static uint16_t
Expand Down Expand Up @@ -579,16 +579,16 @@ pico_dns_question_fill_name( char **qname,
* Creates a standalone DNS Question with a given name and type.
*
* @param url DNS question name in URL format. Will be converted to DNS
* name notation format.
* name notation format.
* @param len Will be filled with the total length of the DNS question.
* @param proto Protocol for which you want to create a question. Can be
* either PICO_PROTO_IPV4 or PICO_PROTO_IPV6.
* either PICO_PROTO_IPV4 or PICO_PROTO_IPV6.
* @param qtype DNS type of the question to be.
* @param qclass DNS class of the question to be.
* @param reverse When this is true, a reverse resolution name will be gene-
* from the URL
* from the URL
* @return Returns pointer to the created DNS Question on success, NULL on
* failure.
* failure.
* ****************************************************************************/
struct pico_dns_question *
pico_dns_question_create( const char *url,
Expand Down Expand Up @@ -664,8 +664,8 @@ pico_dns_question_decompress( struct pico_dns_question *question,
*
* @param record Pointer to DNS record you want to copy flat.
* @param destination Pointer-pointer to flat memory buffer to copy DNS record
* to. When function returns, this will point to location
* right after the flat copied DNS Resource Record.
* to. When function returns, this will point to location
* right after the flat copied DNS Resource Record.
* @return Returns 0 on success, something else on failure.
* ****************************************************************************/
static int
Expand Down Expand Up @@ -709,7 +709,7 @@ pico_dns_record_copy_flat( struct pico_dns_record *record,

/* ****************************************************************************
* Calculates the size of a single DNS Resource Record. Void-pointer allows
* this function to be used with pico_tree_size.
* this function to be used with pico_tree_size.
*
* @param record void-pointer to DNS record you want to know the size of.
* @return Size of single DNS record if it was copied flat.
Expand All @@ -731,7 +731,7 @@ pico_dns_record_size( void *record )

/* ****************************************************************************
* Deletes a single DNS resource record. Void-pointer-pointer allows this
* function to be used with pico_tree_destroy.
* function to be used with pico_tree_destroy.
*
* @param record void-pointer-pointer to DNS record you want to delete.
* @return Returns 0 on success, something else on failure.
Expand Down Expand Up @@ -846,14 +846,14 @@ pico_dns_record_fill_suffix( struct pico_dns_record_suffix **suf,
*
* @param rdata Pointer-pointer to rdata-member of struct pico_dns_record.
* @param _rdata Memory buffer with data to insert in the resource record. If
* data should contain a DNS name, the name in the databuffer
* needs to be in URL-format.
* data should contain a DNS name, the name in the databuffer
* needs to be in URL-format.
* @param datalen The exact length in bytes of the _rdata-buffer. If data of
* record should contain a DNS name, datalen needs to be
* pico_dns_strlen(_rdata).
* record should contain a DNS name, datalen needs to be
* pico_dns_strlen(_rdata).
* @param rtype DNS type of the resource record to be
* @return Returns 0 on failure, length of filled in rdata-member on success.
* Can differ from datalen-param because of URL to DNS Name conversion.
* Can differ from datalen-param because of URL to DNS Name conversion.
* ****************************************************************************/
static uint16_t
pico_dns_record_fill_rdata( uint8_t **rdata,
Expand Down Expand Up @@ -893,11 +893,11 @@ pico_dns_record_fill_rdata( uint8_t **rdata,
* @param url DNS rrecord name in URL format. Will be converted to DNS
* name notation format.
* @param _rdata Memory buffer with data to insert in the resource record. If
* data should contain a DNS name, the name in the databuffer
* needs to be in URL-format.
* data should contain a DNS name, the name in the databuffer
* needs to be in URL-format.
* @param datalen The exact length in bytes of the _rdata-buffer. If data of
* record should contain a DNS name, datalen needs to be
* pico_dns_strlen(_rdata).
* record should contain a DNS name, datalen needs to be
* pico_dns_strlen(_rdata).
* @param len Will be filled with the total length of the DNS rrecord.
* @param rtype DNS type of the resource record to be.
* @param rclass DNS class of the resource record to be.
Expand Down Expand Up @@ -990,7 +990,7 @@ static int pico_tolower(int c)
* @param b 2nd Memory buffer to compare
* @param rdlength_a Length of 1st memory buffer
* @param rdlength_b Length of 2nd memory buffer
* @param caseinsensitive Whether or not the bytes are compared
* @param caseinsensitive Whether or not the bytes are compared
* case-insensitive
* @return 0 when the buffers are equal, returns difference when they're not.
* ****************************************************************************/
Expand Down Expand Up @@ -1074,7 +1074,7 @@ pico_dns_question_cmp( void *qa,
* @param ra DNS record A as a void-pointer (for pico_tree)
* @param rb DNS record B as a void-pointer (for pico_tree)
* @return 0 when name and type of records are equal, returns difference when
* they're not.
* they're not.
* ****************************************************************************/
int
pico_dns_record_cmp_name_type( void *ra,
Expand Down Expand Up @@ -1173,9 +1173,9 @@ pico_tree_destroy( struct pico_tree *tree, int (*node_delete)(void **))
*
* @param tree Pointer to pico_tree-instance
* @param size Will get filled with the size of all the nodes summed up.
* Make sure you clear out (set to 0) this param before you
* call this function because it doesn't happen inside and
* each size will be added to the initial value.
* Make sure you clear out (set to 0) this param before you
* call this function because it doesn't happen inside and
* each size will be added to the initial value.
* @param node_size Helper-function for type-specific size-determination
* @return Amount of items in the tree.
* ****************************************************************************/
Expand Down Expand Up @@ -1335,7 +1335,7 @@ pico_dns_fill_packet_header( struct pico_dns_header *hdr,
*
* @param rtree Tree that contains the DNS resource records.
* @param dest Pointer-pointer to location where you want to insert records.
* Will point to location after current section on return.
* Will point to location after current section on return.
* @return 0 on success, something else on failure.
* ****************************************************************************/
static int
Expand Down
Loading