search for: itoa

Displaying 11 results from an estimated 11 matches for "itoa".

Did you mean: btoa
2019 Oct 16
2
Most efficient way for a function to return two types?
I apologize if this is the wrong list. I'm writing a language and outputting llvm-ir instead of using the c api. I looked at clang's output a few times but I'm a little unsure what to do in this case As an example I have a function called itoa which takes an int and returns a string. Strings in my language has 2 fields, the pointer and byte length. On a 64bit machine it'd be returning a 64bit pointer and 64bit int value. My question is HOW should I do this if I want to generate fast code? And a follow up is should I do it that way if...
2013 May 02
4
[LLVMdev] int to StringRed conversion
Hello everyone, I have an integer and I want to convert it to StringRef in order to set metadata. setMetadata->(StringRef, MDNode*); It is there a native LLVM way to do it? 1. In the llvm::APSInt Class is toString() method, which seems it is not for this purpose 2. itoa and string are not part of LLVM 3. stringstream is not part of LLVM 4. to_string is not part of LLVM 5. any casting method? Also, I would like to get the metadata and convert it back to integer. Thank you ! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http:/...
2013 May 02
0
[LLVMdev] int to StringRed conversion
...; > I have an integer and I want to convert it to StringRef in order to set > metadata. > setMetadata->(StringRef, MDNode*); > > It is there a native LLVM way to do it? > > 1. In the llvm::APSInt Class is toString() method, which seems it is not > for this purpose > 2. itoa and string are not part of LLVM > 3. stringstream is not part of LLVM > 4. to_string is not part of LLVM > 5. any casting method? > > Also, I would like to get the metadata and convert it back to integer. > > Thank you ! > > _______________________________________________...
2013 May 02
2
[LLVMdev] int to StringRed conversion
...t; setMetadata->(StringRef, MDNode*); >>>>> >>>>> It is there a native LLVM way to do it? >>>>> >>>>> 1. In the llvm::APSInt Class is toString() method, which seems it is >>>>> not for this purpose >>>>> 2. itoa and string are not part of LLVM >>>>> 3. stringstream is not part of LLVM >>>>> 4. to_string is not part of LLVM >>>>> 5. any casting method? >>>>> >>>>> Also, I would like to get the metadata and convert it back to integer....
2013 May 02
0
[LLVMdev] int to StringRed conversion
...metadata. >>>> setMetadata->(StringRef, MDNode*); >>>> >>>> It is there a native LLVM way to do it? >>>> >>>> 1. In the llvm::APSInt Class is toString() method, which seems it is >>>> not for this purpose >>>> 2. itoa and string are not part of LLVM >>>> 3. stringstream is not part of LLVM >>>> 4. to_string is not part of LLVM >>>> 5. any casting method? >>>> >>>> Also, I would like to get the metadata and convert it back to integer. >>>> &g...
2013 May 02
0
[LLVMdev] int to StringRed conversion
...ngRef, MDNode*); >>>>>> >>>>>> It is there a native LLVM way to do it? >>>>>> >>>>>> 1. In the llvm::APSInt Class is toString() method, which seems it is >>>>>> not for this purpose >>>>>> 2. itoa and string are not part of LLVM >>>>>> 3. stringstream is not part of LLVM >>>>>> 4. to_string is not part of LLVM >>>>>> 5. any casting method? >>>>>> >>>>>> Also, I would like to get the metadata and convert...
2006 Aug 11
0
[PATCH] [4/5] SMBIOS -- generate SMBIOS tables
...er length for Xen version string */ + char xen_version_str[80]; + /* temporary variables used to build up Xen version string */ + char *p = NULL; /* points to next point of insertion */ + unsigned len = 0; /* length of string already composed */ + char *tmp = NULL; /* holds result of itoa() */ + unsigned tmp_len; /* length of next string to add */ + + hypercall_xen_version(XENVER_guest_handle, uuid); + + /* xen_version major and minor */ + xen_version = hypercall_xen_version(XENVER_version, NULL); + xen_major_version = (uint16_t) (xen_version >> 16); + xen_mi...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...7 @@ varvalue(char *name, int varflags, int flags, int quoted) if (num == 0) return -1; numvar: - len = cvtnum(num); + len = cvtnum(num, flags); break; case '-': p = makestrspace(NOPTS, expdest); @@ -1711,15 +1714,13 @@ casematch(union node *pattern, char *val) * Our own itoa(). */ -STATIC int -cvtnum(intmax_t num) +static size_t cvtnum(intmax_t num, int flags) { int len = max_int_length(sizeof(num)); + char buf[len]; - expdest = makestrspace(len, expdest); - len = fmtstr(expdest, len, "%" PRIdMAX, num); - STADJUST(len, expdest); - return len; + len =...
2006 Aug 22
0
[PATCH] [HVM] Make serial number in SMBIOS table equal to UUID
...19d -r f3a3ee53050e tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Mon Aug 21 13:36:05 2006 +0100 +++ b/tools/firmware/hvmloader/util.h Tue Aug 22 14:34:50 2006 -0400 @@ -25,6 +25,16 @@ void *memset(void *s, int c, unsigned n) void *memset(void *s, int c, unsigned n); char *itoa(char *a, unsigned int i); +/* convert a byte to two lowercase hex digits, with no terminating NUL + character. digits[] must have at least two elements. */ +void byte_to_hex(char *digits, uint8_t byte); + +/* Convert an array of 16 unsigned bytes to a DCE/OSF formatted UUID + string. + +...
2003 Apr 18
1
Broken buildworld in groff, 4.8-stable?
...usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libgroff/getopt1.c /usr_plus/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libgroff/iftoa.c /usr_plus/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libgroff/itoa.c /usr_plus/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libgroff/matherr.c mkdep -f .depend -a /usr_plus/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libgroff/assert.cc /usr_plus/src/gnu/usr.bin/groff/src/libs/libgroff/.....
2006 Apr 13
1
6.1-RC1 fails to compile... missing header files in /usr/src/gnu/usr.bin/groff/src/libs/libgroff?
...gnu/usr.bin/groff/s rc/libs/libgroff/../../../src/include -I/usr/obj/usr/src/tmp/legacy/usr/include /usr/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src /libs/libgroff/iftoa.c /usr/src/gnu/usr.bin/groff/src/libs/libgroff/../../../../ ../../contrib/groff/src/libs/libgroff/itoa.c /usr/src/gnu/usr.bin/groff/src/libs /libgroff/../../../../../../contrib/groff/src/libs/libgroff/matherr.c /usr/src/g nu/usr.bin/groff/src/libs/libgroff/../../../../../../contrib/groff/src/libs/libg roff/progname.c mkdep -f .depend -a /usr/src/gnu/usr.bin/groff/src/libs/libgroff/../../.. /....