Skip to content

Commit eda43c9

Browse files
committed
Modified for -pedantic and POSIX compliance checks
1 parent 9a92608 commit eda43c9

31 files changed

Lines changed: 290 additions & 251 deletions

agent.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <stdio.h>
1313
#include <stdlib.h>
1414
#include <string.h>
15+
#include <strings.h>
1516
#include <time.h>
1617
#include <unistd.h>
1718
#include <getopt.h>

agent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
/* thespecific language governing permissions and limitations under the */
1010
/* License. */
1111
/******************************************************************************/
12-
1312
#ifndef AGENT_H_
1413
#define AGENT_H_
1514

15+
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
16+
1617
#include "session.h"
1718
#include "schedule.h"
1819
#include "config.h"

config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <stdlib.h>
1414
#include <stdio.h>
1515
#include <string.h>
16+
#include <strings.h>
1617
#include <errno.h>
1718
#include <time.h>
1819
#include "config.h"

config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef __CONFIG_H__
1313
#define __CONFIG_H__
1414

15+
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
16+
1517
#include <stdbool.h>
1618
#include <stddef.h>
1719

constants.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
/* thespecific language governing permissions and limitations under the */
1010
/* License. */
1111
/******************************************************************************/
12-
1312
#ifndef __CONSTANTS_H__
1413
#define __CONSTANTS_H__
1514

15+
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
16+
1617
/* These are the GUIDs of the capabilities supported by the Agent */
1718
#define CAP_PEM_INVENTORY "a809ce1f-1eea-4738-a38e-15708c89c981"
1819
#define CAP_PEM_MANAGEMENT "1d411b36-ae72-433f-9f3f-8593e836a1af"

csr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/******************************************************************************/
1212

1313
#include <string.h>
14+
#include <strings.h>
1415
#include "csr.h"
1516
#include "logging.h"
1617
#include "global.h"

csr.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
/* thespecific language governing permissions and limitations under the */
1010
/* License. */
1111
/******************************************************************************/
12-
1312
#ifndef __CSR_H__
1413
#define __CSR_H__
1514

15+
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
16+
1617
#include "dto.h"
1718
#include "config.h"
1819

dto.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "lib/json.h"
1818
#include "logging.h"
1919
#include <string.h>
20+
#include <strings.h>
2021
#include <stdbool.h>
2122

2223
/******************************************************************************/
@@ -317,9 +318,9 @@ SessionRegisterReq_t *SessionRegisterReq_new(char *clientParamPath)
317318
json_foreach(curNode, jsonRoot) {
318319
if (curNode->tag == JSON_STRING &&
319320
curNode->key &&
320-
curNode->string_) {
321+
curNode->u.string_) {
321322
req->ClientParameters[nodeCount++] =
322-
ClientParameter_new(curNode->key, curNode->string_);
323+
ClientParameter_new(curNode->key, curNode->u.string_);
323324
}
324325
}
325326

@@ -718,9 +719,9 @@ SessionRegisterResp_t *SessionRegisterResp_fromJson(char *jsonString)
718719
current = 0;
719720
json_foreach(jsonTmp, jsonParams) {
720721
if (jsonTmp && jsonTmp->tag == JSON_STRING &&
721-
jsonTmp->string_) {
722+
jsonTmp->u.string_) {
722723
resp->Session.ClientParameters[current++] =
723-
ClientParameter_new(jsonTmp->key, jsonTmp->string_);
724+
ClientParameter_new(jsonTmp->key, jsonTmp->u.string_);
724725
}
725726
}
726727
resp->Session.ClientParameters_count = current;
@@ -1537,10 +1538,10 @@ EnrollmentConfigResp_t *EnrollmentConfigResp_fromJson(char *jsonString)
15371538

15381539
JsonNode *keySizeNode = json_find_member(jsonRoot, "KeySize");
15391540
if (keySizeNode && keySizeNode->tag == JSON_NUMBER) {
1540-
resp->KeySize = keySizeNode->number_;
1541+
resp->KeySize = keySizeNode->u.number_;
15411542
} else if (keySizeNode && keySizeNode->tag == JSON_STRING) {
15421543
int tmp;
1543-
if (sscanf(keySizeNode->string_, "%d", &tmp) == 1) {
1544+
if (sscanf(keySizeNode->u.string_, "%d", &tmp) == 1) {
15441545
resp->KeySize = tmp;
15451546
}
15461547
}

dto.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
/* thespecific language governing permissions and limitations under the */
1010
/* License. */
1111
/******************************************************************************/
12-
1312
#ifndef CSS_DTO_H
1413
#define CSS_DTO_H
1514

15+
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
16+
1617
#include <stdbool.h>
1718
#include <stdint.h>
1819
#include "constants.h"

enrollment.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <stdio.h>
1414
#include <stdlib.h>
1515
#include <string.h>
16+
#include <strings.h>
1617
#include "lib/base64.h"
1718
#include "enrollment.h"
1819
#include "httpclient.h"

0 commit comments

Comments
 (0)