Skip to content

Commit

Permalink
Fixed spelling error and removed patch from upb. (protocolbuffers#10693)
Browse files Browse the repository at this point in the history
  • Loading branch information
haberman authored Oct 1, 2022
1 parent d3995ec commit 488b8b9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 44 deletions.
5 changes: 2 additions & 3 deletions protobuf_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
60 changes: 30 additions & 30 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Expand Down
10 changes: 0 additions & 10 deletions upb.patch

This file was deleted.

0 comments on commit 488b8b9

Please sign in to comment.