loplugin:constparams in soltools and various
Change-Id: I5e8e4a9a31aa7c3ff54cc7ce137d08770ea297e1 Reviewed-on: https://gerrit.libreoffice.org/40279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -108,6 +108,11 @@ bool ConstParams::VisitFunctionDecl(FunctionDecl * functionDecl)
|
||||
|| name == "file_write"
|
||||
|| name == "SalMainPipeExchangeSignal_impl"
|
||||
|| name.startswith("SbRtl_")
|
||||
|| name == "my_if_errors"
|
||||
|| name == "my_eval_defined"
|
||||
|| name == "my_eval_variable"
|
||||
// #ifdef win32
|
||||
|| name == "convert_slashes"
|
||||
// UNO component entry points
|
||||
|| name.endswith("component_getFactory")
|
||||
// in Scheduler::, wants to loop until a reference to a bool becomes true
|
||||
|
@@ -163,7 +163,7 @@ bool recursivelyFindType(
|
||||
}
|
||||
|
||||
static inline void * queryDeepNoXInterface(
|
||||
typelib_TypeDescriptionReference * pDemandedTDR, class_data * cd, void * that )
|
||||
typelib_TypeDescriptionReference const * pDemandedTDR, class_data * cd, void * that )
|
||||
{
|
||||
type_entry * pEntries = getTypeEntries( cd );
|
||||
sal_Int32 nTypes = cd->m_nTypes;
|
||||
|
@@ -756,7 +756,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
|
||||
|
||||
void cppuhelper::ServiceManager::loadImplementation(
|
||||
css::uno::Reference< css::uno::XComponentContext > const & context,
|
||||
std::shared_ptr< Data::Implementation > & implementation)
|
||||
std::shared_ptr< Data::Implementation > const & implementation)
|
||||
{
|
||||
assert(implementation.get() != nullptr);
|
||||
{
|
||||
|
@@ -218,7 +218,7 @@ public:
|
||||
|
||||
void loadImplementation(
|
||||
css::uno::Reference< css::uno::XComponentContext > const & context,
|
||||
std::shared_ptr< Data::Implementation > & implementation);
|
||||
std::shared_ptr< Data::Implementation > const & implementation);
|
||||
|
||||
private:
|
||||
virtual ~ServiceManager() override;
|
||||
|
@@ -88,7 +88,7 @@ pfunc_getRefreshToolbars SAL_CALL SetRefreshToolbars( pfunc_getRefreshToolbars p
|
||||
return pOldFunc;
|
||||
}
|
||||
|
||||
void SAL_CALL RefreshToolbars( css::uno::Reference< css::frame::XFrame >& rFrame )
|
||||
void SAL_CALL RefreshToolbars( css::uno::Reference< css::frame::XFrame > const & rFrame )
|
||||
{
|
||||
pfunc_getRefreshToolbars pCallback = nullptr;
|
||||
{
|
||||
|
@@ -70,7 +70,7 @@ FWE_DLLPUBLIC svt::StatusbarController* SAL_CALL CreateStatusBarController(
|
||||
|
||||
FWE_DLLPUBLIC pfunc_getRefreshToolbars SAL_CALL SetRefreshToolbars( pfunc_getRefreshToolbars pRefreshToolbarsFunc );
|
||||
FWE_DLLPUBLIC void SAL_CALL RefreshToolbars(
|
||||
css::uno::Reference< css::frame::XFrame >& rFrame );
|
||||
css::uno::Reference< css::frame::XFrame > const & rFrame );
|
||||
|
||||
FWE_DLLPUBLIC pfunc_createDockingWindow SAL_CALL SetDockingWindowCreator( pfunc_createDockingWindow pCreateDockingWindow );
|
||||
FWE_DLLPUBLIC void SAL_CALL CreateDockingWindow(
|
||||
|
@@ -428,7 +428,7 @@ void handleDirectory(
|
||||
osl::Directory::remove(sPoUrl);
|
||||
}
|
||||
|
||||
void handleProjects(char * sSourceRoot, char const * sDestRoot)
|
||||
void handleProjects(char const * sSourceRoot, char const * sDestRoot)
|
||||
{
|
||||
OUString root16;
|
||||
if (!rtl_convertStringToUString(
|
||||
|
@@ -58,8 +58,8 @@ OString Win_AddLongPathPrefix( const OString &rPathName )
|
||||
#ifdef SYSTEM_DICTS
|
||||
// find old style dictionaries in system directories
|
||||
void GetOldStyleDicsInDir(
|
||||
OUString& aSystemDir, OUString& aFormatName,
|
||||
OUString& aSystemSuffix, OUString& aSystemPrefix,
|
||||
OUString const & aSystemDir, OUString const & aFormatName,
|
||||
OUString const & aSystemSuffix, OUString const & aSystemPrefix,
|
||||
std::set< OUString >& aDicLangInUse,
|
||||
std::vector< SvtLinguConfigDictionaryEntry >& aRes )
|
||||
{
|
||||
|
@@ -38,7 +38,7 @@
|
||||
RTTI identity by comparing string addresses rather than string content).
|
||||
*/
|
||||
|
||||
static void * load(void * address, char const * symbol) {
|
||||
static void * load(void const * address, char const * symbol) {
|
||||
Dl_info dl_info;
|
||||
char * slash;
|
||||
size_t len;
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
void SAL_CALL registerTimer(salhelper::Timer* pTimer);
|
||||
|
||||
/// unregister timer
|
||||
void SAL_CALL unregisterTimer(salhelper::Timer* pTimer);
|
||||
void SAL_CALL unregisterTimer(salhelper::Timer const * pTimer);
|
||||
|
||||
/// lookup timer
|
||||
bool SAL_CALL lookupTimer(const salhelper::Timer* pTimer);
|
||||
@@ -292,7 +292,7 @@ void TimerManager::registerTimer(Timer* pTimer)
|
||||
}
|
||||
}
|
||||
|
||||
void TimerManager::unregisterTimer(Timer* pTimer)
|
||||
void TimerManager::unregisterTimer(Timer const * pTimer)
|
||||
{
|
||||
if (!pTimer)
|
||||
return;
|
||||
|
@@ -503,6 +503,7 @@ void SfxDocTplService_Impl::readFolderList()
|
||||
{
|
||||
SolarMutexGuard aGuard;
|
||||
|
||||
static_assert( SAL_N_ELEMENTS(TEMPLATE_SHORT_NAMES_ARY) == SAL_N_ELEMENTS(TEMPLATE_LONG_NAMES_ARY), "mismatch array lengths" );
|
||||
const size_t nCount = std::min(SAL_N_ELEMENTS(TEMPLATE_SHORT_NAMES_ARY), SAL_N_ELEMENTS(TEMPLATE_LONG_NAMES_ARY));
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
|
@@ -353,7 +353,7 @@ struct hash
|
||||
c ^= b; c -= rot(b,24); \
|
||||
}
|
||||
|
||||
static unsigned int hash_compute( struct hash* hash, const char* key, int length)
|
||||
static unsigned int hash_compute( struct hash const * hash, const char* key, int length)
|
||||
{
|
||||
unsigned int a;
|
||||
unsigned int b;
|
||||
@@ -509,7 +509,7 @@ unsigned int i;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int compare_key(struct hash* hash, const char* a, const char* b, int len, int* cost)
|
||||
static inline int compare_key(struct hash const * hash, const char* a, const char* b, int len, int const * cost)
|
||||
{
|
||||
#ifdef HASH_STAT
|
||||
*cost += 1;
|
||||
|
@@ -179,7 +179,7 @@ void
|
||||
* Generate a pragma import/include directive
|
||||
*/
|
||||
void
|
||||
genimport(char *fname, int angled, char *iname, int import)
|
||||
genimport(char const *fname, int angled, char const *iname, int import)
|
||||
{
|
||||
static Token ta = {UNCLASS, 0, 0, NULL, 0};
|
||||
static Tokenrow tr = {&ta, &ta, &ta + 1, 1};
|
||||
|
@@ -645,7 +645,7 @@ int
|
||||
* if fd==-1 and str, then from the string.
|
||||
*/
|
||||
Source *
|
||||
setsource(char *name, int path, int fd, char *str, int wrap)
|
||||
setsource(char *name, int path, int fd, char const *str, int wrap)
|
||||
{
|
||||
Source *s = new(Source);
|
||||
size_t len;
|
||||
|
@@ -624,7 +624,7 @@ void
|
||||
* corresponding index in the argname array. Return -1 if not found.
|
||||
*/
|
||||
int
|
||||
lookuparg(Nlist * mac, Token * tp)
|
||||
lookuparg(Nlist * mac, Token const * tp)
|
||||
{
|
||||
Token *ap;
|
||||
|
||||
|
@@ -83,7 +83,7 @@ mvl_add( MacroValidatorList * inout_pValidators,
|
||||
|
||||
void
|
||||
mvl_check( MacroValidatorList * inout_pValidators,
|
||||
Token * inout_pTokenToCheck)
|
||||
Token const * inout_pTokenToCheck)
|
||||
{
|
||||
MacroValidator * pV; /* Running pointer */
|
||||
MacroValidator * pCheckedOnes; /* Here new list is built. */
|
||||
|
@@ -251,7 +251,7 @@ int
|
||||
* Canonical whitespace is assured on each side.
|
||||
*/
|
||||
void
|
||||
insertrow(Tokenrow * dtr, int ntok, Tokenrow * str)
|
||||
insertrow(Tokenrow * dtr, int ntok, Tokenrow const * str)
|
||||
{
|
||||
int nrtok = (int)rowlen(str);
|
||||
|
||||
@@ -289,7 +289,7 @@ void
|
||||
* Not strictly conforming.
|
||||
*/
|
||||
void
|
||||
movetokenrow(Tokenrow * dtr, Tokenrow * str)
|
||||
movetokenrow(Tokenrow * dtr, Tokenrow const * str)
|
||||
{
|
||||
size_t nby;
|
||||
|
||||
@@ -325,7 +325,7 @@ void
|
||||
* the space for the contents. Return the destination.
|
||||
*/
|
||||
Tokenrow *
|
||||
copytokenrow(Tokenrow * dtr, Tokenrow * str)
|
||||
copytokenrow(Tokenrow * dtr, Tokenrow const * str)
|
||||
{
|
||||
int len = (int)rowlen(str);
|
||||
|
||||
@@ -543,7 +543,7 @@ char *
|
||||
* Null terminated.
|
||||
*/
|
||||
uchar *
|
||||
newstring(uchar * s, size_t l, size_t o)
|
||||
newstring(uchar const * s, size_t l, size_t o)
|
||||
{
|
||||
uchar *ns = (uchar *) domalloc(l + o + 1);
|
||||
|
||||
|
@@ -172,7 +172,7 @@ void mvl_add(
|
||||
void mvl_check(
|
||||
MacroValidatorList *
|
||||
inout_pValidators,
|
||||
Token * inout_pTokenToCheck);
|
||||
Token const * inout_pTokenToCheck);
|
||||
|
||||
void tokenrow_zeroTokenIdentifiers(Tokenrow* trp);
|
||||
|
||||
@@ -181,7 +181,7 @@ void fixlex(void);
|
||||
void setup(int, char **);
|
||||
int gettokens(Tokenrow *, int);
|
||||
int comparetokens(Tokenrow *, Tokenrow *);
|
||||
Source *setsource(char *, int, int, char *, int);
|
||||
Source *setsource(char *, int, int, char const *, int);
|
||||
void unsetsource(void);
|
||||
void puttokens(Tokenrow *);
|
||||
void process(Tokenrow *);
|
||||
@@ -203,25 +203,25 @@ int gatherargs(Tokenrow *, Tokenrow **, int *);
|
||||
void substargs(Nlist *, Tokenrow *, Tokenrow **);
|
||||
void expandrow(Tokenrow *, char *);
|
||||
void maketokenrow(int, Tokenrow *);
|
||||
Tokenrow *copytokenrow(Tokenrow *, Tokenrow *);
|
||||
Tokenrow *copytokenrow(Tokenrow *, Tokenrow const *);
|
||||
Token *growtokenrow(Tokenrow *);
|
||||
Tokenrow *normtokenrow(Tokenrow *);
|
||||
void adjustrow(Tokenrow *, int);
|
||||
void movetokenrow(Tokenrow *, Tokenrow *);
|
||||
void insertrow(Tokenrow *, int, Tokenrow *);
|
||||
void movetokenrow(Tokenrow *, Tokenrow const *);
|
||||
void insertrow(Tokenrow *, int, Tokenrow const *);
|
||||
void peektokens(Tokenrow *, char *);
|
||||
void doconcat(Tokenrow *);
|
||||
Tokenrow *stringify(Tokenrow *);
|
||||
int lookuparg(Nlist *, Token *);
|
||||
int lookuparg(Nlist *, Token const *);
|
||||
long eval(Tokenrow *, int);
|
||||
void genline(void);
|
||||
void genimport(char *, int, char *, int);
|
||||
void genimport(char const *, int, char const *, int);
|
||||
void genwrap(int);
|
||||
void setempty(Tokenrow *);
|
||||
void makespace(Tokenrow *, Token *);
|
||||
char *outnum(char *, int);
|
||||
int digit(int);
|
||||
uchar *newstring(uchar *, size_t, size_t);
|
||||
uchar *newstring(uchar const *, size_t, size_t);
|
||||
|
||||
#define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp)
|
||||
|
||||
|
@@ -194,7 +194,7 @@ my_eval_variable (IfParser *ip, const char *var, size_t len)
|
||||
}
|
||||
|
||||
|
||||
int cppsetup(char *line)
|
||||
int cppsetup(char const *line)
|
||||
{
|
||||
IfParser ip;
|
||||
int val = 0;
|
||||
|
@@ -151,18 +151,18 @@ char *malloc();
|
||||
char *realloc();
|
||||
#endif
|
||||
|
||||
char *copy(char *);
|
||||
char *copy(char const *);
|
||||
char *base_name(char *);
|
||||
char *get_line(struct filepointer *);
|
||||
char *isdefined(char *);
|
||||
struct filepointer *getfile(char *);
|
||||
struct inclist *newinclude(char *newfile,
|
||||
char *incstring);
|
||||
struct inclist *newinclude(char const *newfile,
|
||||
char const *incstring);
|
||||
struct inclist *inc_path(char *, char *, boolean,
|
||||
struct IncludesCollection *);
|
||||
|
||||
void define( char *def, struct symhash **symbols );
|
||||
void hash_define(char *name, char * val, struct symhash **symbols);
|
||||
void hash_define(char *name, char const * val, struct symhash **symbols);
|
||||
struct symhash *hash_copy( struct symhash *symbols );
|
||||
void hash_free( struct symhash *symbols );
|
||||
void freefile( struct filepointer * fp );
|
||||
@@ -171,19 +171,19 @@ int find_includes(struct filepointer *filep, struct inclist *file,
|
||||
struct IncludesCollection* incCollection, struct symhash *symbols);
|
||||
void included_by(struct inclist *ip,
|
||||
struct inclist * newfile);
|
||||
int cppsetup(char *line);
|
||||
int cppsetup(char const *line);
|
||||
void add_include(struct filepointer *filep, struct inclist *file,
|
||||
struct inclist *file_red, char *include, boolean dot, boolean failOK,
|
||||
struct IncludesCollection* incCollection, struct symhash *symbols);
|
||||
int match(char *str, char **list);
|
||||
int match(char const *str, char **list);
|
||||
void recursive_pr_include(struct inclist *head, char *file,
|
||||
char *base);
|
||||
void recursive_pr_dummy(struct inclist *head, char *file);
|
||||
void inc_clean(void);
|
||||
|
||||
void fatalerr(char *, ...);
|
||||
void warning(char *, ...);
|
||||
void warning1(char *, ...);
|
||||
void warning(char const *, ...);
|
||||
void warning1(char const *, ...);
|
||||
|
||||
void convert_slashes(char *);
|
||||
char *append_slash(char *);
|
||||
|
@@ -32,8 +32,8 @@ in this Software without prior written authorization from the X Consortium.
|
||||
#include <string.h>
|
||||
|
||||
void remove_dotdot( char * );
|
||||
int isdot( char * );
|
||||
int isdotdot( char * );
|
||||
int isdot( char const * );
|
||||
int isdotdot( char const * );
|
||||
int issymbolic(char * dir, char * component);
|
||||
int exists_path(struct IncludesCollection*, char*);
|
||||
|
||||
@@ -223,14 +223,14 @@ void remove_dotdot(char *path)
|
||||
strcpy(path, newpath);
|
||||
}
|
||||
|
||||
int isdot(char *p)
|
||||
int isdot(char const *p)
|
||||
{
|
||||
if(p && p[0] == '.' && p[1] == '\0')
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int isdotdot(char *p)
|
||||
int isdotdot(char const *p)
|
||||
{
|
||||
if(p && p[0] == '.' && p[1] == '.' && p[2] == '\0')
|
||||
return TRUE;
|
||||
@@ -263,7 +263,7 @@ int issymbolic(char *dir, char *component)
|
||||
/*
|
||||
* Add an include file to the list of those included by 'file'.
|
||||
*/
|
||||
struct inclist *newinclude(char *newfile, char *incstring)
|
||||
struct inclist *newinclude(char const *newfile, char const *incstring)
|
||||
{
|
||||
struct inclist *ip;
|
||||
|
||||
|
@@ -525,7 +525,7 @@ void freefile(struct filepointer *fp)
|
||||
free(fp);
|
||||
}
|
||||
|
||||
char *copy(char *str)
|
||||
char *copy(char const *str)
|
||||
{
|
||||
char *p = (char *)malloc(strlen(str) + 1);
|
||||
|
||||
@@ -533,7 +533,7 @@ char *copy(char *str)
|
||||
return p;
|
||||
}
|
||||
|
||||
int match(char *str, char **list)
|
||||
int match(char const *str, char **list)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -670,7 +670,7 @@ void fatalerr(char *msg, ...)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
void warning(char *msg, ...)
|
||||
void warning(char const *msg, ...)
|
||||
{
|
||||
#ifdef DEBUG_MKDEPEND
|
||||
va_list args;
|
||||
@@ -683,7 +683,7 @@ void warning(char *msg, ...)
|
||||
#endif /* DEBUG_MKDEPEND */
|
||||
}
|
||||
|
||||
void warning1(char *msg, ...)
|
||||
void warning1(char const *msg, ...)
|
||||
{
|
||||
#ifdef DEBUG_MKDEPEND
|
||||
va_list args;
|
||||
|
@@ -36,7 +36,7 @@ int gobble( struct filepointer *filep, struct inclist *file,
|
||||
struct inclist *file_red, struct symhash *symbols );
|
||||
int deftype ( char *line, struct inclist *file,
|
||||
int parse_it, struct symhash *symbols);
|
||||
int zero_value(char *exp, struct symhash *symbols);
|
||||
int zero_value(char const *exp, struct symhash *symbols);
|
||||
|
||||
extern struct symhash *maininclist;
|
||||
|
||||
@@ -370,7 +370,7 @@ char * isdefined( char *symbol )
|
||||
/*
|
||||
* Return type based on if the #if expression evaluates to 0
|
||||
*/
|
||||
int zero_value(char *exp, struct symhash *symbols)
|
||||
int zero_value(char const *exp, struct symhash *symbols)
|
||||
{
|
||||
global_symbols = symbols; /* HACK! see above */
|
||||
if (cppsetup(exp))
|
||||
@@ -466,7 +466,7 @@ void hash_free( struct symhash *symbols )
|
||||
free( symbols->s_pairs );
|
||||
}
|
||||
|
||||
void hash_define( char *name, char *val, struct symhash **symbols )
|
||||
void hash_define( char *name, char const *val, struct symhash **symbols )
|
||||
{
|
||||
int hashval;
|
||||
struct pair *it;
|
||||
|
@@ -73,7 +73,7 @@ void add_include(struct filepointer *filep, struct inclist *file, struct inclist
|
||||
}
|
||||
}
|
||||
|
||||
void pr_dummy(struct inclist *ip)
|
||||
void pr_dummy(struct inclist const *ip)
|
||||
{
|
||||
fwrite(ip->i_file, strlen(ip->i_file), 1, stdout);
|
||||
fwrite(" :\n\n", 4, 1, stdout);
|
||||
|
Reference in New Issue
Block a user