Skip to content

Commit 6878a73

Browse files
committed
chore: format c and cpp files
Signed-off-by: Peefy <xpf6677@163.com>
1 parent dcf4f1d commit 6878a73

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

c/lib/pb_decode.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ static bool checkreturn read_raw_value(pb_istream_t* stream, pb_wire_type_t wire
327327

328328
case PB_WT_STRING:
329329
/* Calling read_raw_value with a PB_WT_STRING is an error.
330-
* Explicitly handle this case and fallthrough to default to avoid
331-
* compiler warnings.
332-
*/
330+
* Explicitly handle this case and fallthrough to default to avoid
331+
* compiler warnings.
332+
*/
333333

334334
default:
335335
PB_RETURN_ERROR(stream, "invalid wire_type");
@@ -494,12 +494,12 @@ static bool checkreturn decode_static_field(pb_istream_t* stream, pb_wire_type_t
494494
case PB_HTYPE_ONEOF:
495495
if (PB_LTYPE_IS_SUBMSG(field->type) && *(pb_size_t*)field->pSize != field->tag) {
496496
/* We memset to zero so that any callbacks are set to NULL.
497-
* This is because the callbacks might otherwise have values
498-
* from some other union field.
499-
* If callbacks are needed inside oneof field, use .proto
500-
* option submsg_callback to have a separate callback function
501-
* that can set the fields before submessage is decoded.
502-
* pb_dec_submessage() will set any default values. */
497+
* This is because the callbacks might otherwise have values
498+
* from some other union field.
499+
* If callbacks are needed inside oneof field, use .proto
500+
* option submsg_callback to have a separate callback function
501+
* that can set the fields before submessage is decoded.
502+
* pb_dec_submessage() will set any default values. */
503503
memset(field->pData, 0, (size_t)field->data_size);
504504

505505
/* Set default values for the submessage fields. */
@@ -637,8 +637,8 @@ static bool checkreturn decode_pointer_field(pb_istream_t* stream, pb_wire_type_
637637

638638
if ((size_t)*size + 1 > allocated_size) {
639639
/* Allocate more storage. This tries to guess the
640-
* number of remaining entries. Round the division
641-
* upwards. */
640+
* number of remaining entries. Round the division
641+
* upwards. */
642642
size_t remain = (substream.bytes_left - 1) / field->data_size + 1;
643643
if (remain < PB_SIZE_MAX - allocated_size)
644644
allocated_size += remain;
@@ -1308,11 +1308,11 @@ static bool checkreturn pb_dec_varint(pb_istream_t* stream, const pb_field_iter_
13081308
return false;
13091309

13101310
/* See issue 97: Google's C++ protobuf allows negative varint values to
1311-
* be cast as int32_t, instead of the int64_t that should be used when
1312-
* encoding. Nanopb versions before 0.2.5 had a bug in encoding. In order to
1313-
* not break decoding of such messages, we cast <=32 bit fields to
1314-
* int32_t first to get the sign correct.
1315-
*/
1311+
* be cast as int32_t, instead of the int64_t that should be used when
1312+
* encoding. Nanopb versions before 0.2.5 had a bug in encoding. In order to
1313+
* not break decoding of such messages, we cast <=32 bit fields to
1314+
* int32_t first to get the sign correct.
1315+
*/
13161316
if (field->data_size == sizeof(pb_int64_t))
13171317
svalue = (pb_int64_t)value;
13181318
else

cpp/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mod ffi {
4646
}
4747

4848
/// kcl main.k -E name=path
49-
#[derive(Debug, Default,Clone)]
49+
#[derive(Debug, Default, Clone)]
5050
pub struct ExternalPkg {
5151
pub pkg_name: String,
5252
pub pkg_path: String,
@@ -1451,9 +1451,7 @@ fn lint_path(args: &LintPathArgs) -> Result<LintPathResult> {
14511451
Ok(LintPathResult::new(result))
14521452
}
14531453

1454-
fn build_load_settings_files_args(
1455-
args: &LoadSettingsFilesArgs,
1456-
) -> kcl_api::LoadSettingsFilesArgs {
1454+
fn build_load_settings_files_args(args: &LoadSettingsFilesArgs) -> kcl_api::LoadSettingsFilesArgs {
14571455
kcl_api::LoadSettingsFilesArgs {
14581456
work_dir: args.work_dir.clone(),
14591457
files: args.files.clone(),

0 commit comments

Comments
 (0)