Displaying 20 results from an estimated 20 matches for "strval".
Did you mean:
ptrval
2007 Apr 11
2
Patch for ini plugin
...7 @@
* David Reveman <davidr@novell.com>
*/
+#define _GNU_SOURCE /* for asprintf */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -895,7 +854,6 @@ iniSaveOptions (CompDisplay *d,
while (nOption--)
{
status = FALSE;
- strVal = strdup ("");
int i;
switch (option->type)
@@ -907,8 +865,11 @@ iniSaveOptions (CompDisplay *d,
case CompOptionTypeColor:
case CompOptionTypeMatch:
strVal = iniOptionValueToString (&option->value, option->type);
- if (strVal[0] != '\0')
+ if (strVal)
+...
2003 Dec 04
2
[LLVMdev] A couple questions
...rying to get a function not to be inlined. What are llvm's rules
pertaining to inlining? I have tried all of the standard gcc options
for turning off inlining and they do not seem to work. Here is the
sample code that I am working with:
#include <stdio.h>
void print_string(char* strval);
int main()
{
char* strval = "Hello world\n";
while(1){
print_string(strval);
sleep(15);
}
return 0;
}
void
print_string(char* strval)
{
int i;
for(i=0;i<12;i++){
putc(strval[i], stdout);
}
}
gcc 3.2.2 does not inline this by default. Also, on
llvm.cs.uiuc.edu/demo,...
2010 Mar 05
3
[LLVMdev] Pointer to String Constant
I'm writing a C compiler in OCaml and I've run into a small problem. I wrote
the following piece of code to generate a pointer to a string constant, so I
could compile C expressions of the form "const char* p = "test\n";" :
let strval = const_stringz codecontext v in
dump_value strval;
dump_value i32_zero;
const_gep strval [| i32_zero; i32_zero |]
The dump statements I put confirm that the string array and the index values
have the types I would expect:
[6 x i8] c"test\0A\00"
i32 0
However, the code still seems to b...
2011 Jan 25
1
[RFC] Updates to ACP smart driver
This patch introduces a handful of new options, I mentioned earlier in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02088.html
See the large commit message in the follow-up for the details and rationale.
I realize it's a bit larger diff - so if it's required I can split it into few
smaller ones.
Michal Soltys (1):
APC smart driver update and new features.
2007 Jul 15
3
[LLVMdev] Floating point constants (bug?)
>From the language guide:
"The one non-intuitive notation for constants is the optional
hexadecimal form of floating point constants. For example, the form
'double 0x432ff973cafa8000' is equivalent to (but harder to read than)
'double 4.5e+15'. The only time hexadecimal floating point constants
are required (and the only time that they are generated by the
disassembler) is
2011 Feb 07
4
[PATCH/RFC v2 0/3] Updates to ACP smart driver
This is 2nd version of the earlier patch featuring a few new features
and fixes to the apcsmart driver, following the remarks in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02294.html
Major changes from v1:
- handle battery.charge and battery.runtime checks at main.c level
- handle "immutable but writable" conflict gracefully at driver level
-
2012 Feb 15
3
[LLVMdev] We need better hashing
...ret_cast<const uint32_t *>(&Data),
> reinterpret_cast<const uint32_t *>(&Data + 1));
> }
>
> Similarly, these need to go through a union to avoid TBAA problems.
>
> I'm not sure how that works. Can you give an example?
>
> void add(StringRef StrVal) {
> addImpl(StrVal.data(), StrVal.size());
> }
>
> I'm contradicting my stance above about not caring about the
> implementation :), but is MurmurHash a good hash for string data?
> The Bernstein hash function works really well and is much cheaper to
> compute than...
2011 Mar 05
19
[RFC apcsmart V3 00/18] apcsmart driver updates
Sorry for a bit longer delay than I anticipated, I was stuffed with the work.
This is the next iteration of the patch adding some functionality to apcsmart
driver, and relying on 'ignorelb' recently added.
Follow up from previous thread:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02331.html
Main differences is that V3 is split into many small patches, so the
2012 Feb 15
0
[LLVMdev] We need better hashing
...+ 1));
> }
>
> Similarly, these need to go through a union to avoid TBAA problems.
>
> I'm not sure how that works. Can you give an example?
Just use:
void add(double Data) {
union {
double D; uint64_t I;
};
D = Data;
add(I);
}
>
> void add(StringRef StrVal) {
> addImpl(StrVal.data(), StrVal.size());
> }
>
> I'm contradicting my stance above about not caring about the implementation :), but is MurmurHash a good hash for string data? The Bernstein hash function works really well and is much cheaper to compute than Murmur. It is...
2012 Feb 15
2
[LLVMdev] We need better hashing
...;(&Data),
> reinterpret_cast<const uint32_t *>(&Data + 1));
> }
>
> Similarly, these need to go through a union to avoid TBAA problems.
These are just wrong: they'll hash +0 and -0 to different values even
though they compare ==.
>
> void add(StringRef StrVal) {
> addImpl(StrVal.data(), StrVal.size());
> }
>
> I'm contradicting my stance above about not caring about the implementation
> :), but is MurmurHash a good hash for string data? The Bernstein hash
> function works really well and is much cheaper to compute than Murmu...
2007 Dec 15
2
[LLVMdev] fix warning with newer g++ compilers
...{
++CurPtr;
- while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
+ while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
CurPtr[0] == '.' || CurPtr[0] == '_')
++CurPtr;
llvmAsmlval.StrVal = new std::string(TokStart+1, CurPtr); // Skip @
return GLOBALVAR;
}
-
+
// Handle GlobalVarID: @[0-9]+
if (isdigit(CurPtr[0])) {
- for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr);
-
+ for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr)
+ ;
+
uint64_t Val = atoull(TokSta...
2012 Feb 14
0
[LLVMdev] We need better hashing
...(&Data + 1));
}
/// Add a double
void add(double Data) {
addImpl(
reinterpret_cast<const uint32_t *>(&Data),
reinterpret_cast<const uint32_t *>(&Data + 1));
}
Similarly, these need to go through a union to avoid TBAA problems.
void add(StringRef StrVal) {
addImpl(StrVal.data(), StrVal.size());
}
I'm contradicting my stance above about not caring about the implementation :), but is MurmurHash a good hash for string data? The Bernstein hash function works really well and is much cheaper to compute than Murmur. It is used by HashString...
2012 Feb 13
5
[LLVMdev] We need better hashing
On Mon, Feb 13, 2012 at 1:22 AM, Jay Foad <jay.foad at gmail.com> wrote:
> On 13 February 2012 00:59, Talin <viridia at gmail.com> wrote:
> > Here's my latest version of Hashing.h, which I propose to add to
> llvm/ADT.
> > Comments welcome and encouraged.
>
> > /// Adapted from MurmurHash2 by Austin Appleby
>
> Just out of curiosity, why not
2010 Mar 05
0
[LLVMdev] Pointer to String Constant
...Nyx wrote:
>
> I'm writing a C compiler in OCaml and I've run into a small problem. I wrote
> the following piece of code to generate a pointer to a string constant, so I
> could compile C expressions of the form "const char* p = "test\n";" :
>
> let strval = const_stringz codecontext v in
> dump_value strval;
> dump_value i32_zero;
> const_gep strval [| i32_zero; i32_zero |]
>
> The dump statements I put confirm that the string array and the index values
> have the types I would expect:
>
> [6 x i8] c"test\0A\00"
&...
2012 Feb 17
4
[LLVMdev] We need better hashing
...union to avoid TBAA problems.
>>
>> I'm not sure how that works. Can you give an example?
>
>
> Just use:
>
> void add(double Data) {
> union {
> double D; uint64_t I;
> };
> D = Data;
> add(I);
> }
>
>
>> void add(StringRef StrVal) {
>> addImpl(StrVal.data(), StrVal.size());
>> }
>>
>> I'm contradicting my stance above about not caring about the
>> implementation :), but is MurmurHash a good hash for string data?
>> The Bernstein hash function works really well and is much cheap...
2011 Sep 20
1
Understanding API Documentation for PHP
Hey everyone,
I am brand new to Xapian so forgive me if I am just being noob.
I looked over the sparse documentation for the Xapian library and its PHP
hooks and I am really confused how to complete my index.
I understand how to add documents etc etc etc and how to build queries but
how I do specify in add_value what field type xapian should take (i.e.
tokenized, unindexed, indexed)?
Is there
2013 Oct 26
2
[PATCH] 1. changes for vdiskadm on illumos based platform
..._len = BSWAP_32(*(uint32_t *)nvp);
+ nvp += 4;
+
+ /* skip over name */
+ nvp = nvp + ((name_len + 3) & ~3); /* align */
+
+ type = BSWAP_32(*(uint32_t *)nvp);
+
+ return (type);
+}
+
+static int
+nvpair_value(char *nvp, void *val, int valtype, int *nelmp)
+{
+ int name_len, type, slen;
+ char *strval = val;
+ uint64_t *intval = val;
+
+ /* skip over encode/decode size */
+ nvp += 4 * 2;
+
+ /* skip over name_len */
+ name_len = BSWAP_32(*(uint32_t *)nvp);
+ nvp += 4;
+
+ /* skip over name */
+ nvp = nvp + ((name_len + 3) & ~3); /* align */
+
+ /* skip over type */
+ type = BSWAP_32(*(uint32...
2011 Sep 21
2
Xapian-discuss Digest, Vol 88, Issue 9
...n a PHP based deployment of Xapian
> i can tell you i struggled somewhat with the same thing.
> The PHP wrapper really doesn't clue you in as to what types you should be
> passing to any given method, so you'll find yourself having to wrap a lot
> of
> stuff with intval( ) or strval( ) for the methods to work correctly,
> which is a side effect of trying to use a wrapper designed for a strongly
> typed language with a loosely typed one.
>
> That being said, the api docs are spot on for the most part, i'd recommend
> cracking open xapian.php and reading it in...
2011 Aug 28
2
[LLVMdev] LLVM supports Unicode?
Am 28.08.2011 20:02, schrieb geovanisouza92 at gmail.com:
> Hi, Jo!
>
> I'm trying create a new programming language, and I want that it have
> Unicode support (support for read and manipulate rightly the source-code and
> string literals).
>
> But, in addition, my programming language supports "string interpolation"
> string, and in these interpolations, tiny
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...(1, "On-line - forcing OB temporarily");
ser_send_char(upsfd, 'U');
- usleep(UPSDELAY);
+ struct timespec delay = {0, UPSDELAY}; nanosleep(&delay, NULL);
}
return sdcmd_S(tval);
}
@@ -837,6 +837,7 @@ static int sdcmd_ATn(int cnt)
int n = 0, mmax, ret;
const char *strval;
char timer[4];
+ struct timespec delay;
mmax = cnt == 2 ? 99 : 999;
@@ -853,7 +854,8 @@ static int sdcmd_ATn(int cnt)
upsdebugx(1, "Issuing hard hibernate with %d minutes additional wakeup delay", n*6);
ser_send_char(upsfd, APC_CMD_GRACEDOWN);
- usleep(CMDLONGDELAY);
+ dela...