Downcast all qtsizetype to UINT32 manually, apply consistent identation

This commit is contained in:
Nikolaj Schlej 2022-08-28 12:47:01 +02:00
parent 10e2e60183
commit 4006954bc1
25 changed files with 3398 additions and 3398 deletions

View file

@ -1,14 +1,14 @@
/* ustring.cpp
Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#include "ustring.h"
#include <stdarg.h>
@ -19,9 +19,9 @@ UString usprintf(const char* fmt, ...)
UString msg;
va_list vl;
va_start(vl, fmt);
msg = msg.vasprintf(fmt, vl);
va_end(vl);
return msg;
};
@ -37,16 +37,16 @@ UString urepeated(char c, int len)
#else
#ifdef BSTRLIB_NOVSNP
/* This is just a hack. If you are using a system without a vsnprintf, it is
not recommended that bformat be used at all. */
not recommended that bformat be used at all. */
#define exvsnprintf(r,b,n,f,a) {vsprintf (b,f,a); r = -1;}
#define START_VSNBUFF (256)
#else
#if defined (__GNUC__) && !defined (__PPC__) && !defined(__WIN32__)
/* Something is making gcc complain about this prototype not being here, so
I've just gone ahead and put it in. */
I've just gone ahead and put it in. */
extern "C" {
extern int vsnprintf(char *buf, size_t count, const char *format, va_list arg);
extern int vsnprintf(char *buf, size_t count, const char *format, va_list arg);
}
#endif
@ -64,12 +64,12 @@ UString usprintf(const char* fmt, ...)
bstring b;
va_list arglist;
int r, n;
if (fmt == NULL) {
msg = "<NULL>";
}
else {
if ((b = bfromcstr("")) == NULL) {
msg = "<NULL>";
}
@ -80,14 +80,14 @@ UString usprintf(const char* fmt, ...)
b = bformat("<NULL>");
break;
}
va_start(arglist, fmt);
exvsnprintf(r, (char *)b->data, n + 1, fmt, arglist);
va_end(arglist);
b->data[n] = '\0';
b->slen = (int)(strlen)((char *)b->data);
if (b->slen < n) break;
if (r > n) n = r; else n += n;
}
@ -95,7 +95,7 @@ UString usprintf(const char* fmt, ...)
bdestroy(b);
}
}
return msg;
}