Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
3242-Print-all-64-bit-integers-in-base-10.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3242-Print-all-64-bit-integers-in-base-10.patch of Package erlang
From 8fd34a6fc178b98da2934d0443e749d05d6ba896 Mon Sep 17 00:00:00 2001 From: Rickard Green <rickard@erlang.org> Date: Fri, 8 Jan 2021 11:55:56 +0100 Subject: [PATCH 2/3] Print all 64-bit integers in base 10 --- lib/erl_interface/src/misc/ei_printterm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/erl_interface/src/misc/ei_printterm.c b/lib/erl_interface/src/misc/ei_printterm.c index 7c2cd2d35f..3a464377b1 100644 --- a/lib/erl_interface/src/misc/ei_printterm.c +++ b/lib/erl_interface/src/misc/ei_printterm.c @@ -91,8 +91,25 @@ static char *ei_big_to_str(erlang_big *b) unsigned short *sp; int i; + /* Number of 16-bit digits */ no_digits = (b->arity + 1) / 2; + if (no_digits <= 4) { + EI_ULONGLONG val; + buf_len = 22; + s = buf = malloc(buf_len); + if (!buf) + return NULL; + val = 0; + sp=b->digits; + for (i = 0; i < no_digits; i++) + val |= ((EI_ULONGLONG) sp[i]) << (i*16); + if (b->is_neg) + s += sprintf(s,"-"); + sprintf(s, "%llu", val); + return buf; + } + buf_len = (!!b->is_neg /* "-" */ + 9 /* "#integer(" */ + 10 /* %d */ -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor