Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Issue 819083005: Update the generator to work around a MSVC limitation. (Closed)

Created:
5 years, 11 months ago by dcheng
Modified:
5 years, 11 months ago
Reviewers:
hansmuller, hansmuller1
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, darin (slow to review), jimbe, mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Update the C++ generator to work around a MSVC integral constant bug MSVC doesn't use the C++11 type rules for integral constants. A literal -2147483648 is parsed in two steps: 1) MSVC evalutes 2147483648. Since it is greater than 2^31-1, it decides the type of the integral constant should be unsigned int. 2) It then applies unary minus to an unsigned int, which doesn't do anything. To work around this, the C++ binding generator detects this edge case and splits the constant in two. BUG=445618 R=hansmuller@google.com Committed: https://chromium.googlesource.com/external/mojo/+/e3719475d5971283d1d2250533d53066b2ff9797

Patch Set 1 #

Patch Set 2 : Spaces and grammar #

Patch Set 3 : With comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -8 lines) Patch
M mojo/public/interfaces/bindings/tests/test_structs.mojom View 1 chunk +1 line, -4 lines 0 comments Download
M mojo/public/js/struct_unittests.js View 2 chunks +2 lines, -4 lines 0 comments Download
M mojo/public/tools/bindings/generators/mojom_cpp_generator.py View 1 2 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
dcheng
This seems silly for mojom files to have to hack around. It seems like it ...
5 years, 11 months ago (2014-12-31 00:32:32 UTC) #2
hansmuller1
Beautiful, LGTM. Nit: shouldn't the constant expression have spaces, like: return '(-%d - 1)' % ...
5 years, 11 months ago (2014-12-31 00:45:56 UTC) #4
dcheng
Good point: updated the spaces (and fixed a minor grammar typo). The comment seems like ...
5 years, 11 months ago (2014-12-31 00:50:11 UTC) #5
hansmuller1
On 2014/12/31 00:50:11, dcheng wrote: > Good point: updated the spaces (and fixed a minor ...
5 years, 11 months ago (2014-12-31 00:55:52 UTC) #6
dcheng
On 2014/12/31 at 00:55:52, hansmuller wrote: > On 2014/12/31 00:50:11, dcheng wrote: > > Good ...
5 years, 11 months ago (2014-12-31 01:03:01 UTC) #7
dcheng
5 years, 11 months ago (2015-01-05 21:53:38 UTC) #8
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
e3719475d5971283d1d2250533d53066b2ff9797 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698