Skip to content

Commit ffbecd3

Browse files
committed
Merge branch 'bkemain' into 'oramain'
Improve comments See merge request rwp/rwloadsim!4
2 parents 8219da4 + d43602f commit ffbecd3

File tree

4 files changed

+1023
-1090
lines changed

4 files changed

+1023
-1090
lines changed

src/rwl.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* History
1313
*
14+
* bengsig 27-may-2024 - Improve some comments
1415
* bengsig 17-apr-2024 - nostatistics statement
1516
* bengsig 16-apr-2024 - bit operation on clflags, -=
1617
* bengsig 4-apr-2024 - $oraerror:showoci directive
@@ -356,11 +357,11 @@ extern int nanosleep(struct timespec *, int);
356357

357358
struct rwl_option
358359
{
359-
const char *longn;
360+
const char *longn; // long name e.g. --version
360361
ub4 optbits;
361362
#define RWL_OPT_NOLARG 0
362363
#define RWL_OPT_HASARG 0x00000001 // option must have agument
363-
ub4 shortn;
364+
ub4 shortn; // short name e.g. 'v'
364365
};
365366

366367

@@ -489,6 +490,7 @@ struct rwl_cinfo
489490
text serverr[RWL_DB_SERVERR_LEN]; //
490491
};
491492

493+
// How was a string allocated in rwl_value
492494
enum rwl_vsalloc
493495
{
494496
RWL_SVALLOC_NOT = 0 /* no buffer allocated this MUST have value 0 */
@@ -829,6 +831,7 @@ struct rwl_arglist
829831
};
830832
#define RWL_USER_ARG_OFFSET 500 // offset from ordinary option val in struct option
831833

834+
// RWLOADSIM_PATH
832835
struct rwl_pathlist
833836
{
834837
text *pathname; // name of entry in RWLOADISM_PATH
@@ -1296,12 +1299,14 @@ struct rwl_main
12961299
text sqlbuffer[RWL_MAXSQL+2]; /* text of last SQL */
12971300
} ;
12981301

1302+
// Linked list of contatenation, currently used by rwldoprintf
12991303
struct rwl_conlist
13001304
{
13011305
rwl_estack *estk; // expression
13021306
rwl_conlist *connxt; // linked list pointer
13031307
};
13041308

1309+
// Link list of identifiers, e.g. used for rwlreadline
13051310
struct rwl_idlist
13061311
{
13071312
sb4 idnum; // variable number
@@ -1415,6 +1420,7 @@ struct rwl_localvar
14151420
rwl_type atype; /* the type of the argument */
14161421
};
14171422

1423+
// All operators in the RPN evaluations stack
14181424
enum rwl_stack_t
14191425
{
14201426
RWL_STACK_notinuse = 0
@@ -1662,6 +1668,7 @@ enum rwl_code_t
16621668
, RWL_CODE_SQLEND // return from something with database calls - ceptr1 is variable name (of procedure), ceint2 location guess
16631669
};
16641670

1671+
// Entries in the p-code array
16651672
struct rwl_code
16661673
{
16671674
rwl_code_t ctyp; /* operator - code type */
@@ -1701,7 +1708,9 @@ struct rwl_rastvar /* random string as a variable */
17011708
/* Internal variable names
17021709
* Note that "runseconds" to the user is like
17031710
* a read-only variable, while it really is a
1704-
* function without arguments
1711+
* function without arguments. It should be given
1712+
* by the user as runseconds() as if it were a
1713+
* function
17051714
*/
17061715
#define RWL_LOOPNUMBER_VAR (text *)"loopnumber"
17071716
#define RWL_THREADNUMBER_VAR (text *)"threadnumber"
@@ -1753,7 +1762,6 @@ struct rwl_histogram
17531762
/* execution time statistics structure */
17541763
struct rwl_stats
17551764
{
1756-
//rwl_mutex *mutex_stats; // moved to rwl_identifier due to RWL-600 [rwlmutexget-notinit]
17571765
double wtime, etime, atime, dtime; // wait exec, application time
17581766
ub4 *persec; /* array of per second counters */
17591767
double *wtimsum; // array of per second wait time
@@ -1814,6 +1822,7 @@ extern void rwlexprdestroy(rwl_main *, rwl_estack *);
18141822
// rwlexprbic: vvv -= (vvv/bbb)%2 ? bbb : 0
18151823
// note that bbb must be rwl_onep, rwl_twop, rwl_fourp, etc
18161824
//
1825+
// They can be much simplified once we get bitwise operators
18171826
#define rwlexprbis(rwm, vvv, bbb) \
18181827
/* vvv */ rwlexprpush(rwm, vvv, RWL_STACK_VAR); \
18191828
/* bbb */ rwlexprpush(rwm, bbb, RWL_STACK_NUM); \

0 commit comments

Comments
 (0)