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
Libraries
protobuf-c
Commits
1b4e45e4
Unverified
Commit
1b4e45e4
authored
Mar 21, 2021
by
Ilya Lipnitskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protoc-c: remove dead code
parent
f486c8ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
70 deletions
+0
-70
protoc-c/c_file.cc
protoc-c/c_file.cc
+0
-25
protoc-c/c_file.h
protoc-c/c_file.h
+0
-3
protoc-c/c_helpers.cc
protoc-c/c_helpers.cc
+0
-31
protoc-c/c_helpers.h
protoc-c/c_helpers.h
+0
-11
No files found.
protoc-c/c_file.cc
View file @
1b4e45e4
...
@@ -110,8 +110,6 @@ FileGenerator::FileGenerator(const FileDescriptor* file,
...
@@ -110,8 +110,6 @@ FileGenerator::FileGenerator(const FileDescriptor* file,
extension_generators_
[
i
].
reset
(
extension_generators_
[
i
].
reset
(
new
ExtensionGenerator
(
file
->
extension
(
i
),
dllexport_decl
));
new
ExtensionGenerator
(
file
->
extension
(
i
),
dllexport_decl
));
}
}
SplitStringUsing
(
file_
->
package
(),
"."
,
&
package_parts_
);
}
}
FileGenerator
::~
FileGenerator
()
{}
FileGenerator
::~
FileGenerator
()
{}
...
@@ -248,29 +246,6 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
...
@@ -248,29 +246,6 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
"filename"
,
file_
->
name
(),
"filename"
,
file_
->
name
(),
"basename"
,
StripProto
(
file_
->
name
()));
"basename"
,
StripProto
(
file_
->
name
()));
#if 0
// For each dependency, write a prototype for that dependency's
// BuildDescriptors() function. We don't expose these in the header because
// they are internal implementation details, and since this is generated code
// we don't have the usual risks involved with declaring external functions
// within a .cc file.
for (int i = 0; i < file_->dependency_count(); i++) {
const FileDescriptor* dependency = file_->dependency(i);
// Open the dependency's namespace.
vector<string> dependency_package_parts;
SplitStringUsing(dependency->package(), ".", &dependency_package_parts);
// Declare its BuildDescriptors() function.
printer->Print(
"void $function$();",
"function", GlobalBuildDescriptorsName(dependency->name()));
// Close the namespace.
for (int i = 0; i < dependency_package_parts.size(); i++) {
printer->Print(" }");
}
printer->Print("\n");
}
#endif
const
ProtobufCFileOptions
opt
=
file_
->
options
().
GetExtension
(
pb_c_file
);
const
ProtobufCFileOptions
opt
=
file_
->
options
().
GetExtension
(
pb_c_file
);
for
(
int
i
=
0
;
i
<
file_
->
message_type_count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
file_
->
message_type_count
();
i
++
)
{
...
...
protoc-c/c_file.h
View file @
1b4e45e4
...
@@ -104,9 +104,6 @@ class FileGenerator {
...
@@ -104,9 +104,6 @@ class FileGenerator {
std
::
unique_ptr
<
std
::
unique_ptr
<
ServiceGenerator
>
[]
>
service_generators_
;
std
::
unique_ptr
<
std
::
unique_ptr
<
ServiceGenerator
>
[]
>
service_generators_
;
std
::
unique_ptr
<
std
::
unique_ptr
<
ExtensionGenerator
>
[]
>
extension_generators_
;
std
::
unique_ptr
<
std
::
unique_ptr
<
ExtensionGenerator
>
[]
>
extension_generators_
;
// E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}.
std
::
vector
<
std
::
string
>
package_parts_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
FileGenerator
);
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
FileGenerator
);
};
};
...
...
protoc-c/c_helpers.cc
View file @
1b4e45e4
...
@@ -278,37 +278,6 @@ std::set<std::string> MakeKeywordsMap() {
...
@@ -278,37 +278,6 @@ std::set<std::string> MakeKeywordsMap() {
std
::
set
<
std
::
string
>
kKeywords
=
MakeKeywordsMap
();
std
::
set
<
std
::
string
>
kKeywords
=
MakeKeywordsMap
();
std
::
string
ClassName
(
const
Descriptor
*
descriptor
,
bool
qualified
)
{
// Find "outer", the descriptor of the top-level message in which
// "descriptor" is embedded.
const
Descriptor
*
outer
=
descriptor
;
while
(
outer
->
containing_type
()
!=
NULL
)
outer
=
outer
->
containing_type
();
const
std
::
string
&
outer_name
=
outer
->
full_name
();
std
::
string
inner_name
=
descriptor
->
full_name
().
substr
(
outer_name
.
size
());
if
(
qualified
)
{
return
"::"
+
DotsToColons
(
outer_name
)
+
DotsToUnderscores
(
inner_name
);
}
else
{
return
outer
->
name
()
+
DotsToUnderscores
(
inner_name
);
}
}
std
::
string
ClassName
(
const
EnumDescriptor
*
enum_descriptor
,
bool
qualified
)
{
if
(
enum_descriptor
->
containing_type
()
==
NULL
)
{
if
(
qualified
)
{
return
DotsToColons
(
enum_descriptor
->
full_name
());
}
else
{
return
enum_descriptor
->
name
();
}
}
else
{
std
::
string
result
=
ClassName
(
enum_descriptor
->
containing_type
(),
qualified
);
result
+=
'_'
;
result
+=
enum_descriptor
->
name
();
return
result
;
}
}
std
::
string
FieldName
(
const
FieldDescriptor
*
field
)
{
std
::
string
FieldName
(
const
FieldDescriptor
*
field
)
{
std
::
string
result
=
ToLower
(
field
->
name
());
std
::
string
result
=
ToLower
(
field
->
name
());
if
(
kKeywords
.
count
(
result
)
>
0
)
{
if
(
kKeywords
.
count
(
result
)
>
0
)
{
...
...
protoc-c/c_helpers.h
View file @
1b4e45e4
...
@@ -75,17 +75,6 @@ namespace protobuf {
...
@@ -75,17 +75,6 @@ namespace protobuf {
namespace
compiler
{
namespace
compiler
{
namespace
c
{
namespace
c
{
// Returns the non-nested type name for the given type. If "qualified" is
// true, prefix the type with the full namespace. For example, if you had:
// package foo.bar;
// message Baz { message Qux {} }
// Then the qualified ClassName for Qux would be:
// Foo__Bar__Baz_Qux
// While the non-qualified version would be:
// Baz_Qux
std
::
string
ClassName
(
const
Descriptor
*
descriptor
,
bool
qualified
);
std
::
string
ClassName
(
const
EnumDescriptor
*
enum_descriptor
,
bool
qualified
);
// --- Borrowed from stubs. ---
// --- Borrowed from stubs. ---
template
<
typename
T
>
std
::
string
SimpleItoa
(
T
n
)
{
template
<
typename
T
>
std
::
string
SimpleItoa
(
T
n
)
{
std
::
stringstream
stream
;
std
::
stringstream
stream
;
...
...
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