Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(369)

Issue 1391041: Refactored InfoSink. I have replaced most instances of sprintf with std::ostr... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 7 months ago by Alok Priyadarshi
Modified:
14 years, 7 months ago
Reviewers:
kbr1, dgkoch
CC:
VangelisK, angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Refactored InfoSink. I have replaced most instances of sprintf with std::ostringstream to make it safer. I have made sure that everything still compiles and passes conformance tests.

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -220 lines) Patch
M src/compiler/Common.h View 4 chunks +12 lines, -47 lines 0 comments Download
M src/compiler/ConstantUnion.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/InfoSink.h View 3 chunks +51 lines, -61 lines 6 comments Download
M src/compiler/InfoSink.cpp View 1 chunk +42 lines, -38 lines 0 comments Download
M src/compiler/Initialize.cpp View 1 chunk +11 lines, -27 lines 0 comments Download
M src/compiler/OutputGLSL.cpp View 1 chunk +1 line, -6 lines 0 comments Download
M src/compiler/OutputHLSL.cpp View 1 chunk +1 line, -10 lines 0 comments Download
M src/compiler/SymbolTable.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/Types.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/intermOut.cpp View 5 chunks +15 lines, -22 lines 0 comments Download
M src/compiler/parseConst.cpp View 3 chunks +12 lines, -9 lines 0 comments Download

Messages

Total messages: 5
Alok Priyadarshi
14 years, 7 months ago (2010-05-28 19:58:41 UTC) #1
dgkoch
looks good here.
14 years, 7 months ago (2010-05-28 20:41:15 UTC) #2
kbr1
LGTM with a couple of comments. http://codereview.appspot.com/1391041/diff/1/5 File src/compiler/InfoSink.h (right): http://codereview.appspot.com/1391041/diff/1/5#newcode40 src/compiler/InfoSink.h:40: TInfoSinkBase() {} It ...
14 years, 7 months ago (2010-06-01 19:59:54 UTC) #3
Alok Priyadarshi
http://codereview.appspot.com/1391041/diff/1/5 File src/compiler/InfoSink.h (right): http://codereview.appspot.com/1391041/diff/1/5#newcode40 src/compiler/InfoSink.h:40: TInfoSinkBase() {} It is just being shown that way ...
14 years, 7 months ago (2010-06-01 20:27:31 UTC) #4
kbr1
14 years, 7 months ago (2010-06-01 20:35:36 UTC) #5
http://codereview.appspot.com/1391041/diff/1/5
File src/compiler/InfoSink.h (right):

http://codereview.appspot.com/1391041/diff/1/5#newcode40
src/compiler/InfoSink.h:40: TInfoSinkBase() {}
On 2010/06/01 20:27:32, alokp wrote:
> It is just being shown that way by reitveld because of >80 chars in the old
> code.

I see. That's fine.

http://codereview.appspot.com/1391041/diff/1/5#newcode93
src/compiler/InfoSink.h:93: const char* c_str() const { return sink.c_str(); }
On 2010/06/01 20:27:32, alokp wrote:
> I agree. Deleting this method would require fairly intrusive refactoring of
the
> translator API though. The current API has the following two functions:
> const char* ShGetInfoLog(const ShHandle);
> const char* ShGetObjectCode(const ShHandle);
> I think it should be changed to something similar to OpenGL shader API. The
> client queries for info-log length; allocates a string; passes the allocated
> string to get info-log. I will do it in a different CL if thats fine with you.

That's fine.

> I think using const TPersistString& for str() is fine in this case. str() is
> completely internal to shader translator. Also InfoSink is a member of
> ShCompiler, so it will not get destroyed before the compiler itself.

I see. Sounds fine.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b