Skip to content

Commit ee637ae

Browse files
committed
fixup bfdev: fixed some typos
Signed-off-by: John Sanpe <sanpeqf@gmail.com>
1 parent 6750309 commit ee637ae

File tree

10 files changed

+24
-25
lines changed

10 files changed

+24
-25
lines changed

examples/glob/utils.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ int
1414
main(int argc, const char *argv[])
1515
{
1616
unsigned int count;
17-
const char *patten;
17+
const char *pattern;
1818
bool result;
1919

2020
if (argc < 2) {
21-
bfdev_log_alert("Usage: %s patten string ...\n", argv[0]);
21+
bfdev_log_alert("Usage: %s pattern string ...\n", argv[0]);
2222
return 1;
2323
}
2424

25-
patten = argv[1];
25+
pattern = argv[1];
2626
for (count = 2; count < argc; ++count) {
27-
result = bfdev_glob(patten, argv[count]);
27+
result = bfdev_glob(pattern, argv[count]);
2828
bfdev_log_info("matching %s: %s\n", argv[count], result ? "yes" : "no");
2929
}
3030

examples/notifier/simple.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <bfdev/notifier.h>
1212

1313
static
14-
BFDEV_DEFINE_NOTIFIER(notifer);
14+
BFDEV_DEFINE_NOTIFIER(notifier);
1515

1616
static bfdev_notifier_ret_t
1717
func(void *arg, void *pdata)
@@ -30,25 +30,25 @@ main(int argc, const char *argv[])
3030
node[0].entry = func;
3131
node[0].pdata = "priority=3";
3232

33-
retval = bfdev_notifier_register(&notifer, &node[0]);
33+
retval = bfdev_notifier_register(&notifier, &node[0]);
3434
if (retval)
3535
return retval;
3636

3737
node[1].priority = 2;
3838
node[1].entry = func;
3939
node[1].pdata = "priority=2";
4040

41-
retval = bfdev_notifier_register(&notifer, &node[1]);
41+
retval = bfdev_notifier_register(&notifier, &node[1]);
4242
if (retval)
4343
return retval;
4444

4545
node[2].priority = 1;
4646
node[2].entry = func;
4747
node[2].pdata = "priority=1";
4848

49-
retval = bfdev_notifier_register(&notifer, &node[2]);
49+
retval = bfdev_notifier_register(&notifier, &node[2]);
5050
if (retval)
5151
return retval;
5252

53-
return bfdev_notifier_call(&notifer, "helloworld", -1, NULL);
53+
return bfdev_notifier_call(&notifier, "helloworld", -1, NULL);
5454
}

include/bfdev/array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ bfdev_array_splice(bfdev_array_t *array, unsigned long index,
246246
* @num: the minimum required free space.
247247
*
248248
* Ensure that the buffer has space allocated for at least
249-
* @num bytes. If the current buffer is too small, it will
249+
* @num elements. If the current buffer is too small, it will
250250
* be reallocated, possibly to a larger size than requested.
251251
*
252252
* Return 0 on success or a negative error code on failure.

include/bfdev/glob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
BFDEV_BEGIN_DECLS
1414

1515
extern bfdev_bool
16-
bfdev_glob(const char *patten, const char *string);
16+
bfdev_glob(const char *pattern, const char *string);
1717

1818
BFDEV_END_DECLS
1919

include/bfdev/skiplist.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ bfdev_skiplist_delete(bfdev_skip_head_t *head, bfdev_find_t find, void *pdata);
6767
extern void
6868
bfdev_skiplist_reset(bfdev_skip_head_t *head,
6969
bfdev_release_t release, void *pdata);
70+
7071
/**
7172
* bfdev_skiplist_create - create a skiplist header.
7273
* @alloc: the allocator for this skiplist.

include/bfdev/template/array.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ bfdev_array_append_buff(bfdev_array_t *array, bfdev_buff_t *append);
4242
extern int
4343
bfdev_array_append_cstr(bfdev_array_t *array, const char *append);
4444

45-
4645
/**
4746
* bfdev_array_append_char() - append char into the array.
4847
* @array: the array object.

src/glob.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <export.h>
99

1010
export bfdev_bool
11-
bfdev_glob(const char *patten, const char *string)
11+
bfdev_glob(const char *pattern, const char *string)
1212
{
1313
const char *class, *bpatten, *bstring;
1414
char ptch, stch, tcha, tchb;
@@ -18,7 +18,7 @@ bfdev_glob(const char *patten, const char *string)
1818
bstring = BFDEV_NULL;
1919

2020
for (;;) {
21-
ptch = *patten++;
21+
ptch = *pattern++;
2222
stch = *string++;
2323

2424
switch (ptch) {
@@ -28,16 +28,16 @@ bfdev_glob(const char *patten, const char *string)
2828
break;
2929

3030
case '*':
31-
if (*patten == '\0')
31+
if (*pattern == '\0')
3232
return bfdev_true;
33-
bpatten = patten;
33+
bpatten = pattern;
3434
bstring = --string;
3535
break;
3636

3737
case '[':
3838
match = bfdev_false;
39-
inverted = *patten == '!';
40-
class = patten + inverted;
39+
inverted = *pattern == '!';
40+
class = pattern + inverted;
4141
tcha = *class++;
4242

4343
do {
@@ -57,11 +57,11 @@ bfdev_glob(const char *patten, const char *string)
5757
if (match == inverted)
5858
goto backtrack;
5959

60-
patten = class;
60+
pattern = class;
6161
break;
6262

6363
case '\\':
64-
ptch = *patten++;
64+
ptch = *pattern++;
6565
bfdev_fallthrough;
6666

6767
default: literal:
@@ -75,7 +75,7 @@ bfdev_glob(const char *patten, const char *string)
7575
if (stch == '\0' || !bpatten)
7676
return bfdev_false;
7777

78-
patten = bpatten;
78+
pattern = bpatten;
7979
string = ++bstring;
8080
break;
8181
}

src/refcount-debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bfdev_refcnt_report(bfdev_refcnt_t *ref, bfdev_refcnt_saturation_t type)
4848
break;
4949

5050
default:
51-
bfdev_log_err("(%p) unknow error\n", ref);
51+
bfdev_log_err("(%p) unknown error\n", ref);
5252
return;
5353
}
5454
}

testsuite/bitwalk/fuzzy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ TESTSUITE(
326326
return bitwalk_zero(TEST_SMALL_SIZE, TEST_SMALL_LOOP);
327327
}
328328

329-
330329
TESTSUITE(
331330
"bitwalk:zero_large", NULL, NULL,
332331
"bitwalk zero large test"

testsuite/testsuite.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ options[] = {
2727
{"version", no_argument, 0, 'v'},
2828
{"help", no_argument, 0, 'h'},
2929
{"count", required_argument, 0, 'c'},
30-
{"slient", required_argument, 0, 's'},
30+
{"silent", required_argument, 0, 's'},
3131
{ }, /* NULL */
3232
};
3333

@@ -187,7 +187,7 @@ usage(void)
187187

188188
bfdev_log_err("Mandatory arguments to long options are mandatory for short options too.\n");
189189
bfdev_log_err(" -c, --count=NUM number of repetitions for each test\n");
190-
bfdev_log_err(" -s, --slient do not print debugging information\n");
190+
bfdev_log_err(" -s, --silent do not print debugging information\n");
191191
bfdev_log_err("\n");
192192

193193
align = 0;

0 commit comments

Comments
 (0)