[m-rev.] for review: add builtin 64-bit integer types -- part 2

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Jan 31 00:58:41 AEDT 2018



On Tue, 30 Jan 2018 08:53:24 -0500 (EST), Julien Fischer <jfischer at opturion.com> wrote:
> > @@ -894,30 +895,38 @@ output_uint32_expr(Stream, N, !IO) :-
> >      io.write_uint32(Stream, N, !IO),
> >      io.write_string(Stream, ")", !IO).
> > 
> > -make_int64_literal(N) = Literal :-
> > -    NStr = int_to_string(N),
> > -    string.format("INT64_C(%s)", [s(NStr)], Literal).
> > -
> >  output_uint32_expr_cur_stream(N, !IO) :-
> >      io.output_stream(Stream, !IO),
> >      output_uint32_expr(Stream, N, !IO).
> > 
> > +make_int64_literal(N) = Literal :-
> > +    ( if N = min_int64 then
> > +        Literal = "INT64_MIN"
> > +    else
> > +        NStr = int64_to_string(N),
> > +        string.format("INT64_C(%s)", [s(NStr)], Literal)
> > +    ).
> > +
> > 
> > Is there any particular reason why there is make_Uint64_literal?
> 
> I don't understand your comment here.

That because that should have been:

Is there any particular reason why there is NO make_Uint64_literal?

>    Given an rval which is an {int64,uint64,float) literal, return a name
>    for that rval that is suitable for use as a suffix of a C identifier.
>    Different rvals must be given different names.

That does look good.
 
Zoltan.



More information about the reviews mailing list