mirror of
https://github.com/janet-lang/janet
synced 2024-12-01 04:19:55 +00:00
Whitspace and style changes.
This commit is contained in:
parent
0f0c415bcf
commit
00020ba8ab
@ -502,7 +502,6 @@ static Janet cfun_string_pretty(int32_t argc, Janet *argv) {
|
|||||||
return janet_wrap_buffer(buffer);
|
return janet_wrap_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* code adapted from lua/lstrlib.c http://lua.org
|
* code adapted from lua/lstrlib.c http://lua.org
|
||||||
*/
|
*/
|
||||||
@ -511,7 +510,11 @@ static Janet cfun_string_pretty(int32_t argc, Janet *argv) {
|
|||||||
#define FMT_FLAGS "-+ #0"
|
#define FMT_FLAGS "-+ #0"
|
||||||
#define MAX_FORMAT 32
|
#define MAX_FORMAT 32
|
||||||
|
|
||||||
static const char *scanformat(const char *strfrmt, char *form,char width[3], char precision[3]) {
|
static const char *scanformat(
|
||||||
|
const char *strfrmt,
|
||||||
|
char *form,
|
||||||
|
char width[3],
|
||||||
|
char precision[3]) {
|
||||||
const char *p = strfrmt;
|
const char *p = strfrmt;
|
||||||
memset(width, '\0', 3);
|
memset(width, '\0', 3);
|
||||||
memset(precision, '\0', 3);
|
memset(precision, '\0', 3);
|
||||||
@ -556,7 +559,7 @@ static Janet cfun_string_format(int32_t argc, Janet * argv) {
|
|||||||
char width[3], precision[3];
|
char width[3], precision[3];
|
||||||
int nb = 0; /* number of bytes in added item */
|
int nb = 0; /* number of bytes in added item */
|
||||||
if (++arg >= argc)
|
if (++arg >= argc)
|
||||||
janet_panic("no enough value for format");
|
janet_panic("not enough values for format");
|
||||||
strfrmt = scanformat(strfrmt, form, width, precision);
|
strfrmt = scanformat(strfrmt, form, width, precision);
|
||||||
switch (*strfrmt++) {
|
switch (*strfrmt++) {
|
||||||
case 'c':
|
case 'c':
|
||||||
@ -639,11 +642,6 @@ static Janet cfun_string_format(int32_t argc, Janet * argv) {
|
|||||||
return janet_wrap_buffer(b);
|
return janet_wrap_buffer(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const JanetReg string_cfuns[] = {
|
static const JanetReg string_cfuns[] = {
|
||||||
{
|
{
|
||||||
"string/slice", cfun_string_slice,
|
"string/slice", cfun_string_slice,
|
||||||
|
Loading…
Reference in New Issue
Block a user