Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
protobuf-c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
protobuf-c
Commits
db5252c1
Commit
db5252c1
authored
Feb 08, 2025
by
Robert Edmonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some unused functions
parent
1678f1fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
67 deletions
+0
-67
protoc-gen-c/c_helpers.cc
protoc-gen-c/c_helpers.cc
+0
-64
protoc-gen-c/c_helpers.h
protoc-gen-c/c_helpers.h
+0
-3
No files found.
protoc-gen-c/c_helpers.cc
View file @
db5252c1
...
@@ -90,14 +90,6 @@ namespace protobuf_c {
...
@@ -90,14 +90,6 @@ namespace protobuf_c {
#pragma warning(disable:4996)
#pragma warning(disable:4996)
#endif
#endif
std
::
string
DotsToUnderscores
(
const
std
::
string
&
name
)
{
return
StringReplace
(
name
,
"."
,
"_"
,
true
);
}
std
::
string
DotsToColons
(
const
std
::
string
&
name
)
{
return
StringReplace
(
name
,
"."
,
"::"
,
true
);
}
std
::
string
SimpleFtoa
(
float
f
)
{
std
::
string
SimpleFtoa
(
float
f
)
{
char
buf
[
100
];
char
buf
[
100
];
snprintf
(
buf
,
sizeof
(
buf
),
"%.*g"
,
FLT_DIG
,
f
);
snprintf
(
buf
,
sizeof
(
buf
),
"%.*g"
,
FLT_DIG
,
f
);
...
@@ -333,11 +325,6 @@ std::string FilenameIdentifier(const std::string& filename) {
...
@@ -333,11 +325,6 @@ std::string FilenameIdentifier(const std::string& filename) {
return
result
;
return
result
;
}
}
// Return the name of the BuildDescriptors() function for a given file.
std
::
string
GlobalBuildDescriptorsName
(
const
std
::
string
&
filename
)
{
return
"proto_BuildDescriptors_"
+
FilenameIdentifier
(
filename
);
}
std
::
string
GetLabelName
(
google
::
protobuf
::
FieldDescriptor
::
Label
label
)
{
std
::
string
GetLabelName
(
google
::
protobuf
::
FieldDescriptor
::
Label
label
)
{
switch
(
label
)
{
switch
(
label
)
{
case
google
:
:
protobuf
::
FieldDescriptor
::
LABEL_OPTIONAL
:
return
"optional"
;
case
google
:
:
protobuf
::
FieldDescriptor
::
LABEL_OPTIONAL
:
return
"optional"
;
...
@@ -392,57 +379,6 @@ WriteIntRanges(google::protobuf::io::Printer* printer, int n_values, const int *
...
@@ -392,57 +379,6 @@ WriteIntRanges(google::protobuf::io::Printer* printer, int n_values, const int *
}
}
}
}
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
// XXXXXXXXX this stuff is copied from strutils.cc !!!! XXXXXXXXXXXXXXXXXXXXXXXXXXXXx
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
// ----------------------------------------------------------------------
// StringReplace()
// Replace the "old" pattern with the "new" pattern in a string,
// and append the result to "res". If replace_all is false,
// it only replaces the first instance of "old."
// ----------------------------------------------------------------------
void
StringReplace
(
const
std
::
string
&
s
,
const
std
::
string
&
oldsub
,
const
std
::
string
&
newsub
,
bool
replace_all
,
std
::
string
*
res
)
{
if
(
oldsub
.
empty
())
{
res
->
append
(
s
);
// if empty, append the given string.
return
;
}
std
::
string
::
size_type
start_pos
=
0
;
std
::
string
::
size_type
pos
;
do
{
pos
=
s
.
find
(
oldsub
,
start_pos
);
if
(
pos
==
std
::
string
::
npos
)
{
break
;
}
res
->
append
(
s
,
start_pos
,
pos
-
start_pos
);
res
->
append
(
newsub
);
start_pos
=
pos
+
oldsub
.
size
();
// start searching again after the "old"
}
while
(
replace_all
);
res
->
append
(
s
,
start_pos
,
s
.
length
()
-
start_pos
);
}
// ----------------------------------------------------------------------
// StringReplace()
// Give me a string and two patterns "old" and "new", and I replace
// the first instance of "old" in the string with "new", if it
// exists. If "global" is true; call this repeatedly until it
// fails. RETURN a new string, regardless of whether the replacement
// happened or not.
// ----------------------------------------------------------------------
std
::
string
StringReplace
(
const
std
::
string
&
s
,
const
std
::
string
&
oldsub
,
const
std
::
string
&
newsub
,
bool
replace_all
)
{
std
::
string
ret
;
StringReplace
(
s
,
oldsub
,
newsub
,
replace_all
,
&
ret
);
return
ret
;
}
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// SplitStringUsing()
// SplitStringUsing()
// Split a string using a character delimiter. Append the components
// Split a string using a character delimiter. Append the components
...
...
protoc-gen-c/c_helpers.h
View file @
db5252c1
...
@@ -150,9 +150,6 @@ const char* DeclaredTypeMethodName(google::protobuf::FieldDescriptor::Type type)
...
@@ -150,9 +150,6 @@ const char* DeclaredTypeMethodName(google::protobuf::FieldDescriptor::Type type)
// Convert a file name into a valid identifier.
// Convert a file name into a valid identifier.
std
::
string
FilenameIdentifier
(
const
std
::
string
&
filename
);
std
::
string
FilenameIdentifier
(
const
std
::
string
&
filename
);
// Return the name of the BuildDescriptors() function for a given file.
std
::
string
GlobalBuildDescriptorsName
(
const
std
::
string
&
filename
);
// return 'required', 'optional', or 'repeated'
// return 'required', 'optional', or 'repeated'
std
::
string
GetLabelName
(
google
::
protobuf
::
FieldDescriptor
::
Label
label
);
std
::
string
GetLabelName
(
google
::
protobuf
::
FieldDescriptor
::
Label
label
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment