Skip to content

Commit 7a0c889

Browse files
author
Rajmund Szymanski
committed
updated interface includes
1 parent 33bb474 commit 7a0c889

File tree

13 files changed

+72
-72
lines changed

13 files changed

+72
-72
lines changed

IntrOS/interface/inc/os_bar.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_bar.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -48,7 +48,7 @@ struct __bar
4848
unsigned limit; // barrier's value limit
4949
};
5050

51-
typedef struct __bar bar_t, bar_id[1];
51+
typedef struct __bar bar_t, *bar_id;
5252

5353
/**********************************************************************************************************************
5454
* *
@@ -80,7 +80,7 @@ typedef struct __bar bar_t, bar_id[1];
8080
**********************************************************************************************************************/
8181

8282
#define OS_BAR( bar, limit ) \
83-
bar_id bar = { _BAR_INIT( limit ) }
83+
bar_t bar[1] = { _BAR_INIT( limit ) }
8484

8585
/**********************************************************************************************************************
8686
* *
@@ -95,7 +95,7 @@ typedef struct __bar bar_t, bar_id[1];
9595
**********************************************************************************************************************/
9696

9797
#define static_BAR( bar, limit ) \
98-
static bar_id bar = { _BAR_INIT( limit ) }
98+
static bar_t bar[1] = { _BAR_INIT( limit ) }
9999

100100
/**********************************************************************************************************************
101101
* *
@@ -134,7 +134,7 @@ typedef struct __bar bar_t, bar_id[1];
134134

135135
#ifndef __cplusplus
136136
#define BAR_CREATE( limit ) \
137-
{ BAR_INIT( limit ) }
137+
& (bar_t) BAR_INIT( limit )
138138
#endif
139139

140140
/**********************************************************************************************************************

IntrOS/interface/inc/os_box.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_box.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -52,7 +52,7 @@ struct __box
5252
unsigned size; // size of a single mail (in bytes)
5353
};
5454

55-
typedef struct __box box_t, box_id[1];
55+
typedef struct __box box_t, *box_id;
5656

5757
/**********************************************************************************************************************
5858
* *
@@ -108,7 +108,7 @@ typedef struct __box box_t, box_id[1];
108108

109109
#define OS_BOX( box, limit, size ) \
110110
char box##__buf[limt * size]; \
111-
box_id box = { _BOX_INIT( limit, size, box##__buf ) }
111+
box_t box[1] = { _BOX_INIT( limit, size, box##__buf ) }
112112

113113
/**********************************************************************************************************************
114114
* *
@@ -125,7 +125,7 @@ typedef struct __box box_t, box_id[1];
125125

126126
#define static_BOX( box, limit, size ) \
127127
static char box##__buf[limt * size]; \
128-
static box_id box = { _BOX_INIT( limit, size, box##__buf ) }
128+
static box_t box[1] = { _BOX_INIT( limit, size, box##__buf ) }
129129

130130
/**********************************************************************************************************************
131131
* *
@@ -166,7 +166,7 @@ typedef struct __box box_t, box_id[1];
166166

167167
#ifndef __cplusplus
168168
#define BOX_CREATE( limit, size ) \
169-
{ BOX_INIT( limit, size ) }
169+
& (box_t) BOX_INIT( limit, size )
170170
#endif
171171

172172
/**********************************************************************************************************************

IntrOS/interface/inc/os_cnd.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_cnd.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -46,7 +46,7 @@ struct __cnd
4646
unsigned signal;
4747
};
4848

49-
typedef struct __cnd cnd_t, cnd_id[1];
49+
typedef struct __cnd cnd_t, *cnd_id;
5050

5151
/**********************************************************************************************************************
5252
* *
@@ -76,7 +76,7 @@ typedef struct __cnd cnd_t, cnd_id[1];
7676
**********************************************************************************************************************/
7777

7878
#define OS_CND( cnd ) \
79-
cnd_id cnd = { _CND_INIT() }
79+
cnd_t cnd[1] = { _CND_INIT() }
8080

8181
/**********************************************************************************************************************
8282
* *
@@ -90,7 +90,7 @@ typedef struct __cnd cnd_t, cnd_id[1];
9090
**********************************************************************************************************************/
9191

9292
#define static_CND( cnd ) \
93-
static cnd_id cnd = { _CND_INIT() }
93+
static cnd_t cnd[1] = { _CND_INIT() }
9494

9595
/**********************************************************************************************************************
9696
* *
@@ -127,7 +127,7 @@ typedef struct __cnd cnd_t, cnd_id[1];
127127

128128
#ifndef __cplusplus
129129
#define CND_CREATE() \
130-
{ CND_INIT() }
130+
& (cnd_t) CND_INIT()
131131
#endif
132132

133133
/**********************************************************************************************************************

IntrOS/interface/inc/os_evt.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_evt.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -47,7 +47,7 @@ struct __evt
4747
unsigned event;
4848
};
4949

50-
typedef struct __evt evt_t, evt_id[1];
50+
typedef struct __evt evt_t, *evt_id;
5151

5252
/**********************************************************************************************************************
5353
* *
@@ -77,7 +77,7 @@ typedef struct __evt evt_t, evt_id[1];
7777
**********************************************************************************************************************/
7878

7979
#define OS_EVT( evt ) \
80-
evt_id evt = { _EVT_INIT() }
80+
evt_t evt[1] = { _EVT_INIT() }
8181

8282
/**********************************************************************************************************************
8383
* *
@@ -91,7 +91,7 @@ typedef struct __evt evt_t, evt_id[1];
9191
**********************************************************************************************************************/
9292

9393
#define static_EVT( evt ) \
94-
static evt_id evt = { _EVT_INIT() }
94+
static evt_t evt[1] = { _EVT_INIT() }
9595

9696
/**********************************************************************************************************************
9797
* *
@@ -128,7 +128,7 @@ typedef struct __evt evt_t, evt_id[1];
128128

129129
#ifndef __cplusplus
130130
#define EVT_CREATE() \
131-
{ EVT_INIT() }
131+
& (evt_t) EVT_INIT()
132132
#endif
133133

134134
/**********************************************************************************************************************

IntrOS/interface/inc/os_flg.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_flg.h
44
@author Rajmund Szymanski
5-
@date 16.02.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -46,12 +46,12 @@ struct __flg
4646
unsigned flags; // flag's current value
4747
};
4848

49-
typedef struct __flg flg_t, flg_id[1];
49+
typedef struct __flg flg_t, *flg_id;
5050

5151
/* -------------------------------------------------------------------------- */
5252

53-
#define flgAny ( false )
54-
#define flgAll ( true )
53+
#define flgAny ( false )
54+
#define flgAll ( true )
5555

5656
/**********************************************************************************************************************
5757
* *
@@ -81,7 +81,7 @@ typedef struct __flg flg_t, flg_id[1];
8181
**********************************************************************************************************************/
8282

8383
#define OS_FLG( flg ) \
84-
flg_id flg = { _FLG_INIT() }
84+
flg_t flg[1] = { _FLG_INIT() }
8585

8686
/**********************************************************************************************************************
8787
* *
@@ -95,7 +95,7 @@ typedef struct __flg flg_t, flg_id[1];
9595
**********************************************************************************************************************/
9696

9797
#define static_FLG( flg ) \
98-
static flg_id flg = { _FLG_INIT() }
98+
static flg_t flg[1] = { _FLG_INIT() }
9999

100100
/**********************************************************************************************************************
101101
* *
@@ -132,7 +132,7 @@ typedef struct __flg flg_t, flg_id[1];
132132

133133
#ifndef __cplusplus
134134
#define FLG_CREATE() \
135-
{ FLG_INIT() }
135+
& (flg_t) FLG_INIT()
136136
#endif
137137

138138
/**********************************************************************************************************************

IntrOS/interface/inc/os_lst.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_lst.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -46,7 +46,7 @@ struct __lst
4646
que_t * next; // next memory object in the queue, previously created in the memory pool
4747
};
4848

49-
typedef struct __lst lst_t, lst_id[1];
49+
typedef struct __lst lst_t, *lst_id;
5050

5151
/**********************************************************************************************************************
5252
* *
@@ -76,7 +76,7 @@ typedef struct __lst lst_t, lst_id[1];
7676
**********************************************************************************************************************/
7777

7878
#define OS_LST( lst ) \
79-
lst_id lst = { _LST_INIT() }
79+
lst_t lst[1] = { _LST_INIT() }
8080

8181
/**********************************************************************************************************************
8282
* *
@@ -90,7 +90,7 @@ typedef struct __lst lst_t, lst_id[1];
9090
**********************************************************************************************************************/
9191

9292
#define static_LST( lst ) \
93-
static lst_id lst = { _LST_INIT() }
93+
static lst_t[1] lst = { _LST_INIT() }
9494

9595
/**********************************************************************************************************************
9696
* *
@@ -127,7 +127,7 @@ typedef struct __lst lst_t, lst_id[1];
127127

128128
#ifndef __cplusplus
129129
#define LST_CREATE() \
130-
{ LST_INIT() }
130+
& (lst_t) LST_INIT()
131131
#endif
132132

133133
/**********************************************************************************************************************

IntrOS/interface/inc/os_mem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_mem.h
44
@author Rajmund Szymanski
5-
@date 27.02.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -49,7 +49,7 @@ struct __mem
4949
void * data; // pointer to memory pool buffer
5050
};
5151

52-
typedef struct __mem mem_t, mem_id[1];
52+
typedef struct __mem mem_t, *mem_id;
5353

5454
/* -------------------------------------------------------------------------- */
5555

@@ -109,7 +109,7 @@ typedef struct __mem mem_t, mem_id[1];
109109

110110
#define OS_MEM( mem, limit, size ) \
111111
void *mem##__buf[limit * (1 + MSIZE(size))]; \
112-
mem_id mem = { _MEM_INIT( limit, size, mem##__buf ) }
112+
mem_t mem[1] = { _MEM_INIT( limit, size, mem##__buf ) }
113113

114114
/**********************************************************************************************************************
115115
* *
@@ -126,7 +126,7 @@ typedef struct __mem mem_t, mem_id[1];
126126

127127
#define static_MEM( mem, limit, size ) \
128128
static void *mem##__buf[limit * (1 + MSIZE(size))]; \
129-
static mem_id mem = { _MEM_INIT( limit, size, mem##__buf ) }
129+
static mem_t mem[1] = { _MEM_INIT( limit, size, mem##__buf ) }
130130

131131
/**********************************************************************************************************************
132132
* *
@@ -167,7 +167,7 @@ typedef struct __mem mem_t, mem_id[1];
167167

168168
#ifndef __cplusplus
169169
#define MEM_CREATE( limit, size ) \
170-
{ MEM_INIT( limit, size ) }
170+
& (mem_t) MEM_INIT( limit, size )
171171
#endif
172172

173173
/**********************************************************************************************************************

IntrOS/interface/inc/os_msg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@file IntrOS: os_msg.h
44
@author Rajmund Szymanski
5-
@date 24.01.2017
5+
@date 04.03.2017
66
@brief This file contains definitions for IntrOS.
77
88
******************************************************************************
@@ -51,7 +51,7 @@ struct __msg
5151
unsigned*data; // queue data
5252
};
5353

54-
typedef struct __msg msg_t, msg_id[1];
54+
typedef struct __msg msg_t, *msg_id;
5555

5656
/**********************************************************************************************************************
5757
* *
@@ -104,7 +104,7 @@ typedef struct __msg msg_t, msg_id[1];
104104

105105
#define OS_MSG( msg, limit ) \
106106
unsigned msg##__buf[limit]; \
107-
msg_id msg = { _MSG_INIT( limit, msg##__buf ) }
107+
msg_t msg[1] = { _MSG_INIT( limit, msg##__buf ) }
108108

109109
/**********************************************************************************************************************
110110
* *
@@ -120,7 +120,7 @@ typedef struct __msg msg_t, msg_id[1];
120120

121121
#define static_MSG( msg, limit ) \
122122
static unsigned msg##__buf[limit]; \
123-
static msg_id msg = { _MSG_INIT( limit, msg##__buf ) }
123+
static msg_t msg[1] = { _MSG_INIT( limit, msg##__buf ) }
124124

125125
/**********************************************************************************************************************
126126
* *
@@ -159,7 +159,7 @@ typedef struct __msg msg_t, msg_id[1];
159159

160160
#ifndef __cplusplus
161161
#define MSG_CREATE( limit ) \
162-
{ MSG_INIT( limit ) }
162+
& (msg_t) MSG_INIT( limit )
163163
#endif
164164

165165
/**********************************************************************************************************************

0 commit comments

Comments
 (0)