Commit 77395bfc authored by Ben Avison's avatar Ben Avison
Browse files

Enable GitLab CI/CD

Detail:
* Consolidate and complete .gitignore
* Makefiles: auto-create empty directories
* Enable GitLab CI, and address the warnings generated
* Enable GitLab CD for stubs (used implicitly when linker is invoked by cc)
* Fix bug uncovered by cppcheck: assert() triggered by clients compiled to
  C90 standard was performing zero-page reads
parent 228fc58e
Pipeline #3577 passed with stage
in 3 seconds
/aof/
/derived/swis
/lib/
/linked/
/Makefile.d
/map/
/m_o/
/m_o_rl/
/o/
/objs/
/o_rl/
/rm_o/
/rm_o_rl/
/s/swioptions
/syms/
/test/!TboxCalc/!RunImage,fd3
/test/!TboxCalc/Makefile.d
/test/!TboxCalc/o/
variables:
WHITESPACE_WHITELIST: "./Doc/fwrite ./test/!TboxCalc/Makefile ./BlackLog"
SUPPRESS_JOBS: "softload_gnu"
include:
- project: 'Support/CI'
file: '/RISC_OSLib.yml'
deploy_to_runner:
stage: deploy
only:
refs: [ master ]
tags: [ cross ]
script:
# Depending on whether the pipeline is launched by the merge request or
# manually, VersionNum may or may not have been updated. Switch to the
# tip of master to ensure consistency.
- git checkout origin/master
- 'curl --location --output ~/cache/common/BuildHost.zip -z ~/cache/common/BuildHost.zip "https://gitlab.riscosopen.org/Products/BuildHost/-/jobs/artifacts/master/download?job=latest_package_tree"'
- unzip -q ~/cache/common/BuildHost.zip
- source RiscOS/Env/ROOL/BuildHost.sh
- COMPONENT=SharedCLibrary mk all_libs
# Upload binary
- chmod 400 $SSH_PRIVATE_KEY
- rsync -avc -e "ssh -i $SSH_PRIVATE_KEY" --chown rool:rool --chmod=644 objs/stubs.a root@localhost:/opt/rool/lib/
......@@ -518,6 +518,18 @@ bbe-clibrary: bbe-generic
${CP} clib.rom_link_v ${VERBATIMROMLINK} ${CPFLAGS}
dirs:
${MKDIR} aof
${MKDIR} derived
${MKDIR} lib
${MKDIR} linked
${MKDIR} map
${MKDIR} m_o
${MKDIR} m_o_rl
${MKDIR} o
${MKDIR} o_rl
${MKDIR} rm_o
${MKDIR} rm_o_rl
${MKDIR} syms
${MKDIR} ${LIBDIR}
${MKDIR} ${LIBDIR}.CLib
${MKDIR} ${LIBDIR}.CLib.h
......
......@@ -159,7 +159,7 @@ static int n, d, last, iw;
#define D4(f, a, b, c, d)
#endif
#define IGNORE(param) param = param
#define IGNORE(param) do { (void) (param); } while (0)
#define FALSE 0
#define TRUE 1
......@@ -216,6 +216,7 @@ static BlockP startOfNewHeap;
#define MAXEVENTS 64 /* remember the last MAXEVENTS events */
#ifdef STATS
typedef struct StatsStruct {
StorageInfo stats;
EventInfo events[MAXEVENTS];
......@@ -244,6 +245,7 @@ typedef struct StatsStruct {
} StatsRec, *StatsPtr;
/* static StatsPtr statsP; */
#endif
static char sys_message[60];
......@@ -671,8 +673,8 @@ static int InsertBlockInOverflowList(BlockP block)
}
static int GetMoreOSHeap(size_t minSize, BlockP *base_ptr, size_t *size_ptr)
{ size_t size = *size_ptr;
BlockP base = *base_ptr;
{ size_t size;
BlockP base;
#if !HEAP_ALLOCATED_IN_ASCENDING_ADDRESS_ORDER
BlockP tempBlock;
#endif
......@@ -817,8 +819,9 @@ static int GetMoreOSHeap(size_t minSize, BlockP *base_ptr, size_t *size_ptr)
#ifdef BLOCKS_GUARDED
static int check_heap(void)
{ BlockP block;
{
if (userHeap > 0) {
BlockP block;
for (block = heapLow; ; ) {
if (block >= heapHigh) {
if (block > ADDBYTES(heapHigh,OVERHEAD)) return CORRUPT;
......@@ -968,6 +971,8 @@ split_block:
size = actualSize - (size + OVERHEAD);
tempBlock->size = size | FREEBIT;
// cppcheck seems to overlook possible preceding 'goto split_block'
// cppcheck-suppress knownConditionTrueFalse
if (!fromHighMemory) {
/* The block has been cut from the start of the overflow block.
This means that the large block that was in the overflow list
......@@ -1232,8 +1237,7 @@ extern void _init_alloc(void)
}
void *realloc(void *p, size_t size)
{ int rc;
size_t oldsize;
{ size_t oldsize;
void *newb = NULL;
if (_kernel_processor_mode() & 0xF) { /* not USR26 or USR32 */
if (OSMAligns) { /* allowed to return differently aligned block */
......@@ -1268,9 +1272,13 @@ void *realloc(void *p, size_t size)
if ((oldsize < size) || (size == 0) ||
(oldsize > size+MINBLOCKSIZE+BYTESPERWORD)) {
int rc;
if ((oldsize > size+MINBLOCKSIZE+BYTESPERWORD) && (size != 0)) {
BlockP b = ADDBYTES(p, -OVERHEAD);
b->size = size+BYTESPERWORD | (b->size&(!SIZEMASK));
/* No memory leak here - old value of newb is only non-NULL if oldsize < size
* which is incompatible with oldsize > size+MINBLOCKSIZE+BYTESPERWORD */
// cppcheck-suppress memleak
newb = p;
ADDBYTESTO(b, size+BYTESPERWORD+OVERHEAD);
#ifdef BLOCKS_GUARDED
......@@ -1328,7 +1336,7 @@ extern void *aligned_alloc(size_t align, size_t size)
return (e != NULL) ? NULL : ptr;
} else { /* overallocate to ensure alignment, then return the subset */
if (align < sizeof(RMABlock)) align = sizeof(RMABlock);
oversize = size + align - 1 + sizeof(RMABlock);
oversize = size + align - 1 + sizeof(RMABlock);
ptr = _kernel_RMAalloc(oversize);
if (ptr != NULL) {
RMABlock *bp;
......@@ -1357,12 +1365,12 @@ extern void *aligned_alloc(size_t align, size_t size)
_alloc_die(_kernel_getmessage("malloc failed", "C12"), CORRUPT);
else return NULL;
} else {
BlockP keepBlock, tempBlock;
uintptr_t user = (uintptr_t)ptr;
user = (user + (align - 1)) & ~(align - 1); /* aligned as the user wished */
user += excess; /* doubly aligned to ensure excess */
if (user != (uintptr_t)ptr) {
/* define a new block at the split point */
BlockP keepBlock, tempBlock;
tempBlock = ADDBYTES(ptr, -OVERHEAD);
keepBlock = ADDBYTES(user, -OVERHEAD);
oversize = (uintptr_t)keepBlock - (uintptr_t)ptr;
......
......@@ -42,6 +42,7 @@ typedef union count_position
/* file-name decoding tables are packed away. */
{ int i;
struct s
// cppcheck-suppress unusedStructMember
{ unsigned int posn:12,
line:16,
file:4;
......@@ -142,7 +143,7 @@ void _write_profile(char *filename)
/* and (b) code in misc.c that reads in the binary file created here and */
/* displays the counts attached to a source listing of the original code. */
int count1 = (int)_count1;
int p, w1 = 0, w2 = 0, pass, nfiles = 0, namebytes = 0, ncounts = 0;
int p, pass, nfiles = 0, namebytes = 0, ncounts = 0;
int global_name_offset[256];
char *global_file_map[256]; /* Limits total number of files allowed */
FILE *map_file = fopen(filename, "wb");
......@@ -194,31 +195,29 @@ void _write_profile(char *filename)
s = word_roundup(s);
}
if (pass == 1)
{ int i;
for (i = 0;;i++)
{ if (i >= nfiles)
{ int ii;
for (ii = 0;;ii++)
{ if (ii >= nfiles)
{ global_name_offset[nfiles] = namebytes;
global_file_map[nfiles++] = s;
namebytes += 1 + strlen(s);
namebytes = (namebytes + 3) & (~3);
break;
}
else if (strcmp(s,global_file_map[i]) ==0) break;
else if (strcmp(s,global_file_map[ii]) ==0) break;
}
ncounts++;
}
else
{ int i;
for (i = 0; strcmp(s, global_file_map[i]) !=0; i++);
{ int iii;
for (iii = 0; strcmp(s, global_file_map[iii]) !=0; iii++);
fwrite((int *)(p + 4), 4, 1, map_file);
i = (k.s.line & 0xffff) | (i << 16);
fwrite(&i, 4, 1, map_file);
iii = (k.s.line & 0xffff) | (iii << 16);
fwrite(&iii, 4, 1, map_file);
}
p += 8;
}
}
w2 = w1;
w1 = w;
}
}
fwrite("\xff*ENDCOUNT*\n", 4, 3, map_file); /* Trailer data */
......
......@@ -165,7 +165,6 @@ static int _desktop_report(const char *s, const char *but)
{
_kernel_swi_regs r;
_kernel_oserror err, *e;
char *p, *end;
int flags, h = _desktop_task();
if (h == 0) return 0;
......@@ -178,6 +177,8 @@ static int _desktop_report(const char *s, const char *but)
}
else
{
char *p, *end;
while (*s == ' ')
s++;
......@@ -253,7 +254,8 @@ bool _sys__assert(const char *s, const char *expr, const char *func, const char
if (funclen < 0) funclen = 0;
exprlen = min(exprlen, 251-len-funclen-filelen);
memcpy(expr2, expr, exprlen);
memcpy(func2, func, funclen);
if (func)
memcpy(func2, func, funclen);
memcpy(file2, file, filelen);
expr2[exprlen]='\0';
func2[funclen]='\0';
......@@ -300,14 +302,18 @@ void _sys_msg(const char *s)
#define LF '\n'
#define CR '\r'
#ifdef __riscos
static int isttyname(const char *s)
{ if (s[0] == ':' && (s[1]|0x20) == 't' && (s[2]|0x20) == 't' && s[3] == 0)
return 1; /* string specification (:tt) of terminal stream */
return 0;
}
#endif
FILEHANDLE _sys_open(const char *filename, int openmode)
{ /* nasty magic number interface for openmode */
{
#ifdef __riscos
/* nasty magic number interface for openmode */
static const int modtab[6] = { /* r = */ 0x04c, /* r+ = */ 0x0cc,
/* w = */ 0x4cc, /* w+ = */ 0x4cc,
/* a = */ 0x3cc, /* a+ = */ 0x3cc };
......@@ -343,7 +349,7 @@ retry_open:
return NONHANDLE;
}
return fh;
} else if (fh <= 0) {
} else { /* fh <= 0 */
/* _kernel_osfile(11) creates an empty file of size 'size', of type */
/* given by fb.load, stamped with the current date & time */
fb.load = (openmode & OPEN_B) ? 0xffd : 0xfff; /* data : text */
......@@ -359,6 +365,10 @@ retry_open:
if (fh == _kernel_ERROR) errno = -1;
return NONHANDLE;
}
#else
// TODO
return NONHANDLE;
#endif
}
int _sys_istty(FILE *stream)
......@@ -711,10 +721,7 @@ int system(const char *string)
char *decimal_point = ".";
void _armsys_lib_init(void)
{ char *stdinfile = TTYFILENAME,
*stdoutfile = TTYFILENAME,
*stderrfile = TTYFILENAME;
_getenv_value = NULL;
{ _getenv_value = NULL;
_error_recursion = 0;
#ifdef DDE
if ((_kernel_osbyte(129, 0, 255) & 0xFF) >= 0xA8)
......@@ -729,8 +736,12 @@ void _armsys_lib_init(void)
_init_alloc(); /* as had the allocator */
/* SIGINT events are not safe until about now. */
_raise_stacked_interrupts(); /* enable SIGINT */
if (!_kernel_client_is_module())
if (!_kernel_client_is_module()) {
char *stdinfile = TTYFILENAME,
*stdoutfile = TTYFILENAME,
*stderrfile = TTYFILENAME;
_initio(stdinfile, stdoutfile, stderrfile);
}
}
void _main(char *s, int (*main)(int, char **))
......@@ -829,6 +840,7 @@ no_redirection:
args[i++] = 0;
if (redirection)
{ if (after_file_name &&
// cppcheck-suppress leakReturnValNotUsed
freopen(&args[curarg], mode, &__iob[pre_digit]) == 0) {
_fprintf_lf(stderr,
_kernel_getmessage("can't open '%s' for I/O redirection", "C19"),
......@@ -919,11 +931,10 @@ void _backtrace(int why, int *address, _kernel_unwindblock *uwb)
/* Now unwind the stack. I keep track of sp here (as well as fp), but for */
/* the moment I make no use of it. */
while (uwb->fp!=0)
{ int *z, i, nargs, *argp;
char *name = 0;
int *fp = (int *) uwb->fp;
_kernel_swi_regs r;
{ int *fp = (int *) uwb->fp;
if (lang && (lang[0]=='C') && (lang[1]==0)) {
int *z, i, nargs, *argp;
char *name = 0;
z = (int *)(fp[0] &~ psr_mask);
/* Check that when I save pc in a STM instruction it could save PC+8 or */
/* PC+12 beyond the instruction. */
......@@ -946,6 +957,9 @@ void _backtrace(int why, int *address, _kernel_unwindblock *uwb)
while (mask != 0)
{ argp--;
if (mask & 0xf) ++nargs;
// The below is fine - it's just a cunning way of
// knocking out the least-significant set bit
// cppcheck-suppress oppositeExpression
mask ^= mask & (-mask);
}
}
......
......@@ -254,9 +254,8 @@ static char *getcvttable(int territory, int swi)
void _set_ctype(int territory)
{
unsigned int i, j; /* unsigned is cue to division */
unsigned int j; /* unsigned is cue to division */
unsigned int *ctltable, *uctable, *lctable, *ptable, *stable;
unsigned int ctlw, ucw, lcw, pw, sw;
if (!territory) {
for (j = 0; j < sizeof(ctype); j++)
......@@ -268,6 +267,8 @@ void _set_ctype(int territory)
touppertbl = 0;
tolowertbl = 0;
} else {
unsigned int i;
/* Get property tables - these are byte sex dependant */
ctltable = getpropertytable(territory, TERRITORY_PROPERTY_CONTROL);
uctable = getpropertytable(territory, TERRITORY_PROPERTY_UPPERCASE);
......@@ -277,6 +278,8 @@ void _set_ctype(int territory)
j = 0;
/* Check to see this generates sensible assembler */
for (i = 0; i < 256 / 32; i++) {
unsigned int ctlw, ucw, lcw, pw, sw;
ctlw = ctltable[i];
ucw = uctable[i];
lcw = lctable[i];
......@@ -322,6 +325,7 @@ void _set_ctype(int territory)
void _ctype_init(void)
{
// cppcheck-suppress negativeIndex
__ctype[-1] = IL; /* for ctype(EOF) */
_set_ctype(0);
}
......
......@@ -73,7 +73,7 @@ void __assert2(const char *expr, const char *func, const char *file, int line)
extern _kernel_oserror *_kernel_peek_last_oserror(void);
extern char *_hostos_error_string(int no, char *buf) {
buf = buf; /* unused */
(void) buf; /* unused */
if (no == -1) {
_kernel_oserror *e = _kernel_peek_last_oserror();
return (e == NULL) ? _kernel_getmessage("unspecified error", "C69") : e->errmess;
......
......@@ -33,6 +33,7 @@
/* fpprintf wants to know about the system part of the FILE descriptor, but
it doesn't need to know about _extradata */
// cppcheck-suppress unusedStructMember
typedef struct __extradata {void *dummy;} __extradata;
/* Beware the following type and extern must match the one in printf.c */
......@@ -162,7 +163,7 @@ static int fp_digits(char *buff, double d)
/* The sign of d is returned in the LSB of x, and x has to be halved to */
/* obtain the 'proper' value it needs. */
{
unsigned int a[3], w, d0, d1, d2, d3;
unsigned int a[3], w;
int x, i;
_stfp(d, a);
w = a[0];
......@@ -175,7 +176,8 @@ static int fp_digits(char *buff, double d)
buff[1] = '1';
}
else
{ d0 = (w>>24) & 0xf;
{ unsigned int d0, d1, d2, d3;
d0 = (w>>24) & 0xf;
d1 = (w>>20) & 0xf;
d2 = (w>>16) & 0xf;
d3 = (w>>12) & 0xf;
......@@ -259,12 +261,13 @@ static int fp_digits(char *buff, double d)
d2low = 0.0;
w = dx;
if (w<0)
{ w = -w;
{ double dtmp;
w = -w;
/* the code here needs to set (d3, d3low) to a one-and-a-half precision */
/* version of the constant 0.2. */
d3 = 0.2;
d3low = 0.0;
_fp_normalize(d3, d3low);
dtmp = 0.0;
_fp_normalize(d3, dtmp);
d3low = (1.0 - 5.0*d3)/5.0;
}
else
......@@ -586,7 +589,9 @@ static int fp_display(int ch, double *lvd, char buff[], int flags,
hextab = ch=='a' ? "0123456789abcdef" : "0123456789ABCDEF";
// cppcheck-suppress invalidPointerCast
whi = ((unsigned *)lvd)[0];
// cppcheck-suppress invalidPointerCast
wlo = ((unsigned *)lvd)[1];
/* take 3 off exponent because putting 4 bits before . */
bx = ((whi >> 20) & 0x7FF) - 0x3FF;
......
......@@ -152,10 +152,7 @@ static void setlconv(int category, int *values)
char *setlocale(int category, const char *locale)
{
static char lc_str[LC_STR_SIZE];
int tmp_locales[N_LC_MAX] = {0, 0, 0, 0, 0};
_kernel_swi_regs r;
char *s;
int i, n, tz;
/* I expect the category to be a bit-map - complain if out of range */
if (((unsigned)category > LC_ALL) || (category == 0))
......@@ -167,6 +164,10 @@ char *setlocale(int category, const char *locale)
__locales[0], __locales[1], __locales[2], __locales[3], __locales[4]);
return lc_str;
} else {
int tmp_locales[N_LC_MAX] = {0, 0, 0, 0, 0};
char *s;
int i, n;
/* set locale */
if (strcmp(locale, "ISO8859-1") == 0)
locale = "UK";
......@@ -183,6 +184,7 @@ char *setlocale(int category, const char *locale)
tmp_locales[i] = n;
}
} else {
int tz;
if (*locale == 0 || strcmp(locale, "C") == 0) {
/* ISO9899 7.11.1.1 Use "" for current locale, "C" for minimal locale */
n = 0; tz = 0;
......@@ -293,7 +295,7 @@ static char *getterritorytimeinfo(int territory, const struct tm *tt, char *fmt,
r.r[0] = TERRITORY_EXTRACT(territory);
r.r[1] = (int)&utc_block;
r.r[2] = (int)buff;
r.r[3] = CDT_BUFFSIZE | (1<<30) | (1<<31); /* No DST, R5 cs offset */
r.r[3] = CDT_BUFFSIZE | (1u<<30) | (1u<<31); /* No DST, R5 cs offset */
r.r[4] = (int)fmt;
r.r[5] = 0;
if (_kernel_swi(swi, &r, &r) != NULL)
......@@ -381,7 +383,7 @@ static void getiso8601week(char *buff, int spec, int year, int wday, int yday)
size_t strftime(char *s, size_t maxsize, const char *fmt, const struct tm *tt)
{
int p = 0, c;
int p = 0;
char *ss, buff[CDT_BUFFSIZE];
int territory;
......@@ -389,7 +391,8 @@ size_t strftime(char *s, size_t maxsize, const char *fmt, const struct tm *tt)
territory = __locales[N_LC_TIME];
#define push(ch) { s[p++]=(ch); if (p>=maxsize) return 0; }
for (;;)
{ switch (c = *fmt++)
{ int c;
switch (c = *fmt++)
{
case 0: s[p] = 0;
return p;
......
......@@ -668,7 +668,7 @@ float tanhf(float x)
double asinh(double x)
{
if (x == 0) return x; // asinh(0) returns 0
if (x == 0) return x; // asinh(+/-0) returns +/-0
double y = fabs(x), s; // rounding mode UP/DOWN danger here
......@@ -1117,7 +1117,7 @@ double tgamma(double x)
if (isnan(x)) return x;
if (x == 0)
return 1 / x; // Inf, with Divide By Zero
return 1 / x; // +/-Inf, with Divide By Zero
if (floor(x) == x)
{
......@@ -1152,7 +1152,7 @@ float tgammaf(float x)
if (isnan(x)) return x;
if (x == 0)
return 1 / x; // Inf, with Divide By Zero
return 1 / x; // +/-Inf, with Divide By Zero
if (floorf(x) == x)
{
......@@ -1200,7 +1200,7 @@ static double gser05(double x, double epsilon)
/* 1 - P(0.5,x); good for x >= 1.5. */
static double gcf05(double x, double epsilon)
{
double an,b,c,d,del,h;
double b,c,d,h;
#define FPMIN 1e-300
b = x+0.5;
......@@ -1208,7 +1208,8 @@ static double gcf05(double x, double epsilon)
d = 1/b;
h = d;
for (int i=1; ; i++)
{ an = i*(0.5-i);
{ double an,del;
an = i*(0.5-i);
b += 2;
d = an*d+b;
if (fabs(d) < FPMIN) d = FPMIN;
......
......@@ -26,6 +26,7 @@
#define __system_io 1 /* makes stdio.h declare more */
/* sprintf wants to know about the system part of the FILE descriptor, but
it doesn't need to know about _extradata */
// cppcheck-suppress unusedStructMember
typedef struct _extradata {void *dummy;} _extradata;
#include "hostsys.h"
......@@ -83,7 +84,7 @@ int _sprintf_lf(char *buff, const char *fmt, ...);
#define pre_padding(p) \
if (!(flags&_LJUSTIFY)) \
{ char padchar = flags & _PADZERO ? '0' : ' '; \
{ char padchar = (flags & _PADZERO) ? '0' : ' '; \
pr_padding(padchar, width, p); }
#define post_padding(p) \
......@@ -178,9 +179,10 @@ static int printf_display(FILE *p, int flags, int ch, int precision, int width,
/* floating point numbers are in buff[] the normal way around, while */
/* integers have been pushed in with the digits in reverse order. */
if (flags & _FPCONV)
{ int i, c;
{ int i;
for (i = 0; i<len; i++)
{ switch (c = buff[i])
{ int c;
switch (c = buff[i])
{
case '<': pr_padding('0', before_dot, p);
break;
......@@ -492,14 +494,14 @@ static int no_fp_display(int ch, double *d, char buff[], int flags,
char **lvprefix, int *lvprecision, int *lvbefore_dot,
int *lvafter_dot)
{
ch = ch;
d = d;
buff = buff;
flags = flags;
lvprefix = lvprefix;
lvprecision = lvprecision;
lvbefore_dot = lvbefore_dot;
lvafter_dot = lvafter_dot;
(void) ch;
(void) d;
(void) buff;
(void) flags;
(void) lvprefix;
(void) lvprecision;
(void) lvbefore_dot;
(void) lvafter_dot;
return 0;
}
......
......@@ -83,6 +83,7 @@ static int ch_val(int ch, int radix)
/* etc. The test below is isalpha() etc. This means that this test */
/* may not work in a non-C locale where isalpha('{') may be true */
/* (e.g. Swedish ASCII). */
// cppcheck-suppress knownConditionTrueFalse
if ('A' == 193) /* ebcdic */
val = (isdigit(ch) ? (ch) - '0' :
isalpha(ch) ? (ch |= 0x40, /* quick ebcdic toupper */
......@@ -135,22 +136,22 @@ case '+': ch = countgetc(p);
if (!(flag & NOSTORE))
{ /* This code is pretty specious on a 2's complement machine */
if (flag & ALLOWSIGN)
{ long long m = flag & NUMNEG ? -n : n;
int *p = va_arg(res, int *); /* rely on sizeof(int*)=sizeof(short*) */
if isCHAR_(flag) *(signed char *)p = (signed char)m;
else if isSHORT_(flag) *(short *)p = (short)m;
else if isLONG_(flag) *(long *)p = (long)m;
else if isLONGLONG_(flag) *(long long *)p = m;
else *(int *)p = (int)m;
{ long long m = (flag & NUMNEG) ? -n : n;
int *pp = va_arg(res, int *); /* rely on sizeof(int*)=sizeof(short*) */
if isCHAR_(flag) *(signed char *)pp = (signed char)m;
else if isSHORT_(flag) *(short *)pp = (short)m;
else if isLONG_(flag) *(long *)pp = (long)m;
else if isLONGLONG_(flag) *(long long *)pp = m;