Fixed spelling error and removed patch from upb. (#10693)

pull/10701/head
Joshua Haberman 2 years ago committed by GitHub
parent d3995ec400
commit 488b8b91f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      protobuf_deps.bzl
  2. 60
      ruby/ext/google/protobuf_c/ruby-upb.c
  3. 2
      ruby/ext/google/protobuf_c/ruby-upb.h
  4. 10
      upb.patch

@ -115,7 +115,6 @@ def protobuf_deps():
_github_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
commit = "128ac1c9354fd25e765db0d16550ed485f7d130f",
sha256 = "3466942800f7b513b6a3418004bc389b3316a6ca7d3aa6682a81bdce58aac824",
patches = ["@com_google_protobuf//:upb.patch"],
commit = "82c6c4876161ccc6ce165121f925c56722abb926",
sha256 = "4c82bff4f790dbb5a11ec40b1fac44e7c95d9a63fd215a13aaf44cb27b10ac27",
)

@ -219,7 +219,7 @@
/* ASAN poisoning (for arena).
* If using UPB from an interpreted language like Ruby, a build of the
* interpreter compiled with ASAN enbabled must be used in order to get sane and
* interpreter compiled with ASAN enabled must be used in order to get sane and
* expected behavior.
*/
@ -10035,6 +10035,35 @@ bool upb_inttable_iter_isequal(const upb_inttable_iter* i1,
}
// Must be last.
int upb_Unicode_ToUTF8(uint32_t cp, char* out) {
if (cp <= 0x7f) {
out[0] = cp;
return 1;
}
if (cp <= 0x07ff) {
out[0] = (cp >> 6) | 0xc0;
out[1] = (cp & 0x3f) | 0x80;
return 2;
}
if (cp <= 0xffff) {
out[0] = (cp >> 12) | 0xe0;
out[1] = ((cp >> 6) & 0x3f) | 0x80;
out[2] = (cp & 0x3f) | 0x80;
return 3;
}
if (cp <= 0x10ffff) {
out[0] = (cp >> 18) | 0xf0;
out[1] = ((cp >> 12) & 0x3f) | 0x80;
out[2] = ((cp >> 6) & 0x3f) | 0x80;
out[3] = (cp & 0x3f) | 0x80;
return 4;
}
return 0;
}
#include <stdlib.h>
// Must be last.
@ -12606,35 +12635,6 @@ void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size) {
upb_FixLocale(buf);
}
// Must be last.
int upb_Unicode_ToUTF8(uint32_t cp, char* out) {
if (cp <= 0x7f) {
out[0] = cp;
return 1;
}
if (cp <= 0x07ff) {
out[0] = (cp >> 6) | 0xc0;
out[1] = (cp & 0x3f) | 0x80;
return 2;
}
if (cp <= 0xffff) {
out[0] = (cp >> 12) | 0xe0;
out[1] = ((cp >> 6) & 0x3f) | 0x80;
out[2] = (cp & 0x3f) | 0x80;
return 3;
}
if (cp <= 0x10ffff) {
out[0] = (cp >> 18) | 0xf0;
out[1] = ((cp >> 12) & 0x3f) | 0x80;
out[2] = ((cp >> 6) & 0x3f) | 0x80;
out[3] = (cp & 0x3f) | 0x80;
return 4;
}
return 0;
}
/* See port_def.inc. This should #undef all macros #defined there. */
#undef UPB_SIZE

@ -220,7 +220,7 @@
/* ASAN poisoning (for arena).
* If using UPB from an interpreted language like Ruby, a build of the
* interpreter compiled with ASAN enbabled must be used in order to get sane and
* interpreter compiled with ASAN enabled must be used in order to get sane and
* expected behavior.
*/

@ -1,10 +0,0 @@
--- BUILD
+++ BUILD
@@ -1022,6 +1022,7 @@ upb_amalgamation(
":reflection",
":table_internal",
":upb",
+ ":unicode_internal",
],
prefix = "ruby-",
strip_import_prefix = ["src"],
Loading…
Cancel
Save