[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] possible minor changes to code

From: Carlos Montiers
Subject: [Tinycc-devel] possible minor changes to code
Date: Tue, 4 Mar 2014 06:27:37 -0300

Hello. I check the tiny c project with cppcheck, and i found this next:

tiny_impdef.c line 228
p = tcc_realloc(p, n0 = n0 ? n0 * 2 : 256);
maybe should be:
p = tcc_realloc(p, n0 ? n0 * 2 : 256);

x86_64-gen.c line 504
assert((v >= TREG_XMM0) || (v <= TREG_XMM7));
maybe should be:
assert((v >= TREG_XMM0) && (v <= TREG_XMM7));

tccgen.c line 2272
maybe should be:
if (t & VT_UNSIGNED)

tccgen.c line 165
s = *ps;
maybe should be:
//s = *ps; because is assigned in next line

tccpp.c line 2917
assign address of local variable to a function parameter (i not understand this), but for case

tccpp.c line 279
sprintf(p, "%Lu", cv->ull);
maybe should be: //the mask is unsigned long but the value is unsigned long long
sprintf(p, "%llu", cv->ull);
sprintf(p, "%Lu", (unsigned long)cv->ull);

c67-gen.c lines 1904 and 1905 are unncesseary because are the same condition that lines 1902 and 1903

tcc.c line 82
int ret = spawnvp(P_NOWAIT, prog, (char *const*)argv);
maybe should be: //because spawnvp spect (const char * const *)
int ret = spawnvp(P_NOWAIT, prog, (const char * const *)argv);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]