Skip to content

Commit

Permalink
pdb: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent f222016 commit d8cd464
Show file tree
Hide file tree
Showing 2 changed files with 393 additions and 347 deletions.
60 changes: 29 additions & 31 deletions src/modules/pdb/common.h
Expand Up @@ -21,7 +21,7 @@
#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdint.h>
#include <stdint.h>

/*!
0 no carrier id defined.
Expand All @@ -39,10 +39,12 @@
#define PAYLOADSIZE 249


#define IS_VALID_PDB_CARRIERID(id) ((id>=MIN_PDB_CARRIERID) && (id<=MAX_PDB_CARRIERID))
#define IS_VALID_CARRIERID(id) ((id>=MIN_PDB_CARRIERID) && (id<=MAX_CARRIERID))
#define IS_VALID_PDB_CARRIERID(id) \
((id >= MIN_PDB_CARRIERID) && (id <= MAX_PDB_CARRIERID))
#define IS_VALID_CARRIERID(id) \
((id >= MIN_PDB_CARRIERID) && (id <= MAX_CARRIERID))

#define PDB_VERSION 1
#define PDB_VERSION 1

#ifdef __SUNPRO_C
#define ENUM_ATTR_PACKED enum
Expand All @@ -52,40 +54,36 @@

typedef int16_t carrier_t;

ENUM_ATTR_PACKED pdb_versions {
PDB_VERSION_1 = 1,
PDB_VERSION_MAX
};
ENUM_ATTR_PACKED pdb_versions{PDB_VERSION_1 = 1, PDB_VERSION_MAX};

ENUM_ATTR_PACKED pdb_types {
PDB_TYPE_REQUEST_ID = 0, /* request pdb type */
PDB_TYPE_REPLY_ID, /* reply pdb type */
PDB_TYPE_MAX
};
ENUM_ATTR_PACKED pdb_types{PDB_TYPE_REQUEST_ID = 0, /* request pdb type */
PDB_TYPE_REPLY_ID, /* reply pdb type */
PDB_TYPE_MAX};

ENUM_ATTR_PACKED pdb_codes {
PDB_CODE_DEFAULT = 0, /* for request */
PDB_CODE_OK, /* for response - OK */
PDB_CODE_NOT_NUMBER, /* for response - letters found in the number */
PDB_CODE_NOT_FOUND, /* for response - no pdb_id found for the number */
PDB_CODE_MAX
};
ENUM_ATTR_PACKED pdb_codes{PDB_CODE_DEFAULT = 0, /* for request */
PDB_CODE_OK, /* for response - OK */
PDB_CODE_NOT_NUMBER, /* for response - letters found in the number */
PDB_CODE_NOT_FOUND, /* for response - no pdb_id found for the number */
PDB_CODE_MAX};

struct __attribute__((packed)) pdb_hdr {
uint8_t version;
uint8_t type;
uint8_t code;
uint8_t length;
uint16_t id;
struct __attribute__((packed)) pdb_hdr
{
uint8_t version;
uint8_t type;
uint8_t code;
uint8_t length;
uint16_t id;
};

struct __attribute__((packed)) pdb_bdy {
char payload[PAYLOADSIZE];
struct __attribute__((packed)) pdb_bdy
{
char payload[PAYLOADSIZE];
};

struct __attribute__((packed)) pdb_msg {
struct pdb_hdr hdr;
struct pdb_bdy bdy;
struct __attribute__((packed)) pdb_msg
{
struct pdb_hdr hdr;
struct pdb_bdy bdy;
};

#endif

0 comments on commit d8cd464

Please sign in to comment.