summaryrefslogtreecommitdiff
path: root/upb
AgeCommit message (Collapse)Author
2016-04-14Added migration flag for users using old JSON format.Josh Haberman
2016-04-06Refactored upb_def_freeze() a bit per PR comments.Josh Haberman
2016-04-06Changes for PR comments.Josh Haberman
2016-04-05Added upb::FileDef, which represents the file defs are declared in.Josh Haberman
It is entirely optional: MessageDef/EnumDef can still exist on their own. But this can represent a def's file when it is desirable to do so (eg. for code generators). This approach will require that we change the way we handle extensions. But I think it will be a good change overall. Specifically, we previously handled extensions by duplicating the extended message and then adding the extension as a regular field to the duplicated message. This required also duplicating any messages that could reach the extended message. In the new world we will need a way of declaring and looking up extensions separately from the message being extended. This change also involves some notable changes to the generated code: - files are now called foo.upbdefs.h instead of foo.upb.h. This reflects the fact that we might possibly generate several different output files for a .proto file, and this one is just for defs. - we no longer generate selectors in the .h file. - the upbdefs.c no longer vends a SymbolTable. Now it vends the individual messages (and possibly a FileDef later). I think this will compose better once we can generate files where one generated files imports another. We also make the descriptor reader vend a list of FileDefs now. This is the best conceptual match for parsing a FileDescriptorSet.
2016-03-08Make OneofDef stop deriving from Def.Josh Haberman
It is clear now that oneofs are different form other defs in one important way: they are not top-level constructs that can stand on their own in a SymbolTable, for example. If you are iterating over a list of Defs in a SymbolTable, there is no chance you will run into a oneof. To reflect this reality, OneofDef no longer derives from Def, and the UPB_DEF_ONEOF is no longer an enum value that needs to be handled.
2016-02-21Add missing FieldDef::index() definitionMattia Barbon
2016-02-18Fixed const correctness of json_nice_escape().Josh Haberman
2016-02-18Merge pull request #48 from jackdoe/masterJoshua Haberman
make googlepb compile with gcc < 4.5.1
2016-02-18indent according to google-style-guideborislav nikolov
https://google.github.io/styleguide/cppguide.html#Constructor_Initializer_Lists ``` // If the signature and initializer list are not all on one line, // you must wrap before the colon and indent 4 spaces: MyClass::MyClass(int var) : some_var_(var), some_other_var_(var + 1) { DoSomething(); } ``` and ``` // As with any other code block, the close curly can be on the same // line as the open curly, if it fits. MyClass::MyClass(int var) : some_var_(var) {} ```
2016-02-17Added assertions for getjsonname() return.Josh Haberman
2016-02-17Addressed code review comments.Josh Haberman
2016-02-17Changed JSON parser/printer to correctly camelCase names.Josh Haberman
2016-02-17make it compile with gcc < 4.5.1borislav nikolov
$ make Q= googlepb g++ -O3 -std=c++98 -pedantic -Wno-long-long -Wall -Wextra -Wpointer-arith -Wno-unused-private-field -I. -DNDEBUG -c -o obj/upb/bindings/googlepb/bridge.o upb/bindings/googlepb/bridge.cc In file included from ./upb/handlers.h:22, from ./upb/bindings/googlepb/bridge.h:42, from upb/bindings/googlepb/bridge.cc:8: ./upb/def.h: In constructor ‘upb::Pointer<upb::Def>::Pointer(upb::Def*)’: ./upb/def.h:39: error: class ‘upb::Pointer<upb::Def>’ does not have any field named ‘PointerBase’ ./upb/def.h:39: error: no matching function for call to ‘upb::PointerBase<upb::Def, upb::RefCounted>::PointerBase()’ ./upb/upb.h:246: note: candidates are: upb::PointerBase<T, Base>::PointerBase(T*) [with T = upb::Def, Base = upb::RefCounted] ./upb/upb.h:244: note: upb::PointerBase<upb::Def, upb::RefCounted>::PointerBase(const upb::PointerBase<upb::Def, upb::RefCounted>&) ... the generated code looks like: template <> class Pointer<upb::Def> : public PointerBase<upb::Def, upb::RefCounted> { public: explicit Pointer(upb::Def* ptr) : PointerBase(ptr) {} }; .. which falls into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=189 (http://stackoverflow.com/questions/8887864/template-base-constructor-call-in-member-initialization-list-error) changing the generated code to: template <> class Pointer<upb::Def> : public PointerBase<upb::Def, upb::RefCounted> { public: explicit Pointer(upb::Def* ptr) : PointerBase<upb::Def, upb::RefCounted>(ptr) {} }; makes it compile at least on 4.4.7 that we are testing with: $ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
2016-01-26Added small explanatory comment.Josh Haberman
2016-01-19Optimized upb_inttable_compact(): it shrinks inttables more now.Josh Haberman
2016-01-06Merge pull request #45 from mbarbon/fix-status-initJoshua Haberman
Make sure upb_pbdecoder.status is initialized
2015-12-30Make sure upb_pbdecoder.status is initializedMattia Barbon
Otherwhise the end message callback is passed a garbage value.
2015-12-30Add missing upb_fielddef_fullname implementationMattia Barbon
2015-10-21Addressed PR comments.Josh Haberman
2015-10-15Properly populate field presence flag on messages according to syntax flag.Josh Haberman
2015-10-14Add flag to MessageDef for whether fields have presence.Josh Haberman
2015-08-19Refer to a shared definition for max buffered bytes.Josh Haberman
2015-08-14Added lots of decoder tests and fixed lots of bugs.Josh Haberman
2015-08-11More decoder fixes, and slightly changed parse call semantics.Josh Haberman
Prior to this change, if an error was returned, it would be guaranteed to always return a short byte count. Now the two concepts are a bit more orthogonal. There are cases where the entire input is consumed even though an error was encountered.
2015-07-31Decoder fix: skipped data at end of submessage.Josh Haberman
2015-07-30Fixed PR for JIT-enabled builds.Josh Haberman
2015-07-30Changed parser semantics around skipping.Josh Haberman
Prior to this change: parse(buf, len) -> len + N ...would indicate that the next N bytes of the input are not needed, *and* would advance the decoding position by this much. After this change: parse(buf, len) -> len + N parse(NULL, N) -> N ...can be used to achieve the same thing. But skipping the N bytes is not explicitly performed by the user. A user that doesn't want/need to skip can just say: parsed = parse(buf, len); if (parsed < len) { // Handle suspend, advance stream by "parsed". } else { // Stream was advanced by "len" (even if parsed > len). } Updated unit tests to test this new behavior, and refactored test utility code a bit to support it.
2015-07-15Clear JSON parser status in reset.Josh Haberman
2015-07-15Updated JSON parser size.Josh Haberman
2015-07-15Fixed JSON parser error reporting.Josh Haberman
This was previously broken -- it would try to set the status object on the parser, but the pointer was never initialized. Also it didn't report errors properly to the environment object.
2015-07-07Also remove license headers from Lua.Josh Haberman
2015-07-07Updated license headers for Ragel source also.Josh Haberman
2015-07-07Brought into compliance with Google open-source policies.Josh Haberman
- removed myself from Author headers in source files. - removed copyright notices from source file headers. - added CONTRIBUTING.md
2015-07-07Moved DynASM to third_party to comply with Google policy.Josh Haberman
2015-06-22Merge pull request #30 from haberman/encoderfixJoshua Haberman
Fixed some bad bugs in upb_env.
2015-06-22Fixed some bad bugs in upb_env.Josh Haberman
Also added a unit test for upb_encoder that demonstrates the bugs and the fix.
2015-06-15Addressed code review comment and clarified comments.Josh Haberman
2015-06-12Fix for stack overflow for cyclic defs.Josh Haberman
Fixes this bug that came up in the Ruby extension: https://github.com/google/protobuf/issues/425
2015-06-12Fix amalgamation by changing include style for structdef.int.h.Josh Haberman
2015-06-06Fix for va_copy.Josh Haberman
2015-06-04Fixes from Google-internal.Josh Haberman
2015-06-03Merge branch 'master' into google-internalJosh Haberman
2015-06-03Sync from Google-internal development.Josh Haberman
2015-06-02Ported upb to C89, for greater portability.Josh Haberman
A large part of this change contains surface-level porting, like moving variable declarations to the top of the block. However there are a few more substantial things too: - moved internal-only struct definitions to a separate file (structdefs.int.h), for greater encapsulation and ABI compatibility. - removed the UPB_UPCAST macro, since it requires access to the internal-only struct definitions. Replaced uses with calls to inline, type-safe casting functions. - removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros. Class and struct definitions are now more explicit -- you get to see the actual class/struct keywords in the source. The casting convenience functions have been moved into UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2(). - the new way that we duplicate base methods in derived types is also more convenient and requires less duplication. It is also less greppable, but hopefully that is not too big a problem. Compiler flags (-std=c89 -pedantic) should help to rigorously enforce that the code is free of C99-isms. A few functions are not available in C89 (strtoll). There are temporary, hacky solutions in place.
2015-05-18Updates from code review comments.Josh Haberman
2015-05-17Restructure tables for C89 port and smaller size.Josh Haberman
Changes the data layout of tables slightly so that string keys are prefixed with their size, rather than the size being inline in the table itself. This has a few benefits: 1. inttables shrink a bit, because there is no longer a wasted and unused size field sitting in them. 2. This avoids the need to have a union in the table. This is important for an impending C89 port of upb, since C89 has literally no way of statically initializing a non-first union member.
2015-05-16JIT bugfix: align stack properly on getbytes_slow.Josh Haberman
2015-05-16Enabled asserts() and verbosity for most Travis builds.Josh Haberman
Also added a separate ndebug build for testing that -DNDEBUG builds still work. Also disabled reference debugging by default, since it requires either a global lock or -DUPB_THREAD_UNSAFE.
2015-05-15Merge pull request #19 from cfallin/upb-seededalloc-fixJoshua Haberman
Bugfix: seeded_alloc() should not realloc() user-provided memory.
2015-05-15Bugfix: seeded_alloc() should not realloc() user-provided memory.Chris Fallin
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback