search for: c_str

Displaying 20 results from an estimated 256 matches for "c_str".

Did you mean: __str
2009 Nov 13
1
[LLVMdev] dodgy use of c_str()
...c-4.2/trunk/gcc/llvm-debug.cpp: void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { // Gather location information. expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); DIType TyD = getOrCreateType(TREE_TYPE(decl)); const char *DispName = GV->getNameStr().c_str(); Isn't this use of c_str() dodgy, because the temporary string returned by Gv->getNameStr() will be destroyed at the end of the expression, so it's no longer valid to use the memory pointed to by DispName? Thanks, Jay.
2006 May 07
2
[LLVMdev] The Next Win32 File System Problem
...xe: Can't move './libgcc.a-000003' to './libgcc.a-000002': Cannot create a file when that file already exists. So apparently, we're trying to move one file on top of another. The error is generated in: Path::renamePathOnDisk(const Path& newName) { if (!MoveFile(path.c_str(), newName.c_str())) ThrowError("Can't move '" + path + "' to '" + newName.path + "': "); return true; } I'm guessing that the last part of the error message ("Cannot create a file when that file already exists")...
2015 Oct 13
2
Indexing fails with .. FIELDS_INDEX_EXTENSION).c_str() )' failed
...m: /home/stephan/packages/wheezy/i386/clucene-core-2.3.3.4/src/core/CLucene/index/DocumentsWriter.cpp:210: std::string lucene::index::DocumentsWriter::closeDocStore(): Assertion `numDocsInStore*8 == directory->fileLength( (docStoreSegment + "." + IndexFileNames::FIELDS_INDEX_EXTENSION).c_str() )' failed. Aborted I am using dovecot 2:2.2.19-1~auto+7& libclucene-core1:i386 2.3.3.4-4 from debian wheezy backports. Please advice. -Akash
2006 May 07
0
[LLVMdev] The Next Win32 File System Problem
....a-000003' to './libgcc.a-000002': Cannot create a file when that file already exists. > > So apparently, we're trying to move one file on top of another. > > The error is generated in: > > Path::renamePathOnDisk(const Path& newName) { > if (!MoveFile(path.c_str(), newName.c_str())) > ThrowError("Can't move '" + path + > "' to '" + newName.path + "': "); > return true; > } > > I'm guessing that the last part of the error message ("Cannot create a > file whe...
2004 Dec 23
3
[LLVMdev] Undefined referenceto`llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::P
Hi Reid, The error still exists. However, looking on the function in Win32/Path.cpp: -------------- void sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) ThrowError("Can't copy '" + Src.toString() + "' to '" + Dest.toString() + "'"); } -------------- I notice, that the function is living in the sys namespace. Shouldn't it live in the Path class instea...
2015 Oct 13
0
Indexing fails with .. FIELDS_INDEX_EXTENSION).c_str() )' failed
...n/packages/wheezy/i386/clucene-core-2.3.3.4/src/core/CLucene/index/DocumentsWriter.cpp:210: > std::string lucene::index::DocumentsWriter::closeDocStore(): Assertion > `numDocsInStore*8 == directory->fileLength( (docStoreSegment + "." + > IndexFileNames::FIELDS_INDEX_EXTENSION).c_str() )' failed. > Aborted > > I am using dovecot 2:2.2.19-1~auto+7& libclucene-core1:i386 2.3.3.4-4 > from debian wheezy backports. Please advice. Looks like a bug in clucene library. I don't know if there's anything that can be done about it on Dovecot side. I recommend...
2011 Oct 13
1
how to return a matrix of strings from c to R ?
...esult = PROTECT(Rf_allocMatrix(STRSXP,s->n_rics,s->n_fields)); int i,j; for (i=0; i < s->n_rics; i++) { for (j=0; j < s->n_fields; j++) { std::string text = s->data[j][i]; result[j][i] = R_alloc( text.length(), sizeof(char)); //strcpy(result[j][i], text.c_str()); SET_STRING_ELT(result[j][i],0,Rf_mkChar(text.c_str())); } } // memcpy(result,s->data.ref(),s->n_fields*s->n_rics*sizeof(200)); UNPROTECT(1); return result; </code> Can someone please make me understand this usecase and how to resolve it? thanks, Alok -- View th...
2005 Aug 26
1
wchar and wstring.
...face to some C++ files which make use of std::wstring classes for internationalization. Previously (when I wanted to make R strings from C++ std::strings), I would do something like this to construct a string in R from the results of the parse. SET_VECTOR_ELT(vals, i++, mkString(header.GetHeader().c_str())); However, now the call header.GetHeader().c_str() returns a pointer to an array of wchar_t's. I was going to use wcstombs() to convert the wchar_t* to char*, but I wanted to see if there was a similar function in R for the mkString function which I had initially used which deals with wcha...
2013 Jun 19
2
Compact databases and removing stale records at the same time
.../* we never write to compresion targets again */ c->set_compaction_level(Xapian::Compactor::FULLER); c->set_multipass(true); c->compact(); } catch (const Xapian::Error &err) { syslog(LOG_ERR, "IOERROR: Xapian: caught exception: %s: %s", err.get_context().c_str(), err.get_description().c_str()); r = IMAP_IOERROR; } return r; } /* cb returns true if document should be copied, false if not */ int xapian_filter(const char *dest, const char **sources, int (*cb)(const char *cyrusid, void *rock), void *rock) { int r = 0; int count =...
2007 Dec 26
2
[LLVMdev] Instantiating modules from .bc files
...re out how to take the output from llvm-gcc and actually use it in another program. I tried to get a module out of a file that I'd read in to it using this code: MemoryBuffer* memBuf = MemoryBuffer::getFile(filename, sizeof filename, &errStr); printf("errStr: %s\n", errStr.c_str()); BitcodeReader::BitcodeReader bcReader(memBuf); Module* Mod = bcReader.materializeModule(&errInfo); printf("errInfo: %s\n", errInfo.c_str()); verifyModule(*Mod, PrintMessageAction); The errStr and the errInfo strings were empty, but I got a crash on the verifyModule call. The...
2003 Jul 23
3
ov_open returning OV_EBADHEADER
Hi there. I'm having this problem when trying to open the stream to play it. What I'm doing is the following: archivo_original = fopen(Archivo.c_str(), "r"); if (archivo_original == NULL) { if (EventLog) EventLog->WriteString(Format("No se pudo abrir el archivo %s", ARRAYOFCONST((Archivo)))); WaveOut->Stop(); return; } if (resultado = ov_open(archivo_original, &oggvorbis_file,...
2005 Jul 28
1
[LLVMdev] [patch] gccld not properly constructing paths when checking for bytecode
...need a bit of tweaking. Here's a patch: Index: lib/System/Unix/Path.inc =================================================================== RCS file: /var/cvs/llvm/llvm/lib/System/Unix/Path.inc,v retrieving revision 1.43 diff -r1.43 Path.inc 436c436,439 < DIR* direntries = ::opendir(path.c_str()); --- > std::string dirPath = path; > if (dirPath[dirPath.size() - 1] != '/') > dirPath += '/'; > DIR* direntries = ::opendir(dirPath.c_str()); 444c447 < Path aPath(path + (const char*)de->d_name); --- > Path aPath(dirPath + (const char*)...
2016 Mar 23
4
Building ModulePass independiently on win32
Hi, I have written a ModulePass (c++ code) that does transformation to LLVM bytecode. How do I build,compile and run it on windows. a) I need Win32 LLVM tools. (so I downloaded)b) How do I build the dll( modulepass) so that I can pass it to optimizer or other llvm tool.c) To test, I need to compile a test C code, emit llvm intermediate code and pass it to optimizer so  that it can run my
2014 Dec 15
2
Replace atoi and atol with strtol strtoul:Need Help
Hello, I am working on replacing atoi () and atol() functions with strtol() and strtoul() . I came across many files which uses statement like these time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known but wikipedia says that it is integer so is it necessary to replace atoi with strtol over here ?? And is their any document which helps me what each file function does like date.cc,cgiparams.cc,omega.cc,query.cc. Thank You -------------- next part ----------...
2004 Dec 24
0
[LLVMdev] Undefined referenceto`llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::P
...and Linux. Reid. On Thu, 2004-12-23 at 15:48, Henrik Bach wrote: > Hi Reid, > > The error still exists. However, looking on the function in Win32/Path.cpp: > -------------- > void > sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { > if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) > ThrowError("Can't copy '" + Src.toString() + > "' to '" + Dest.toString() + "'"); > } > -------------- > > I notice, that the function is living in the sys namespace. Shouldn't it...
2017 Sep 30
2
invalid code generated on Windows x86_64 using skylake-specific features
...arget_machine = LLVMCreateTargetMachine(target_ref, buf_ptr(&g->triple_str), target_specific_cpu_args, target_specific_features, opt_level, reloc_mode, LLVMCodeModelDefault); char *ZigLLVMGetHostCPUName(void) { std::string str = sys::getHostCPUName(); return strdup(str.c_str()); } char *ZigLLVMGetNativeFeatures(void) { SubtargetFeatures features; StringMap<bool> host_features; if (sys::getHostCPUFeatures(host_features)) { for (auto &F : host_features) features.AddFeature(F.first(), F.second); } return strdup(features...
2004 Dec 23
2
[LLVMdev] Undefined reference to `llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::P
...ls/gccld/gccld.cpp:127: undefined reference to `llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::Path const&)' collect2: ld returned 1 exit status --------------- Path.cpp: --------------- void CopyFile(const sys::Path &Dest, const sys::Path &Src) { if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) ThrowError("Can't copy '" + Src.toString() + "' to '" + Dest.toString() + "'"); } --------------- Henrik. ============================================================= Henrik Bach Open Source Developer...
2004 Dec 24
2
[LLVMdev]Undefinedreferenceto`llvm::sys::CopyFile(llvm::sys::Path const&,llvm::sys::P
...o`llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::P Date: Fri, 24 Dec 2004 00:48:26 +0100 Hi Reid, The error still exists. However, looking on the function in Win32/Path.cpp: -------------- void sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) ThrowError("Can't copy '" + Src.toString() + "' to '" + Dest.toString() + "'"); } -------------- I notice, that the function is living in the sys namespace. Shouldn't it live in the Path class instea...
2004 Dec 24
1
[LLVMdev] Undefined referenceto`llvm::sys::CopyFile(llvm::sys::Path const&, llvm::sys::P
...12-23 at 15:48, Henrik Bach wrote: > > >>Hi Reid, >> >>The error still exists. However, looking on the function in Win32/Path.cpp: >>-------------- >>void >>sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { >> if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) >> ThrowError("Can't copy '" + Src.toString() + >> "' to '" + Dest.toString() + "'"); >>} >>-------------- >> >>I notice, that the function is living in the sys namespace....
2007 Dec 26
0
[LLVMdev] Instantiating modules from .bc files
...Writer.h are the public interface to that functionality. > I tried to get a module out of a file that I'd read in to it using > this code: > > MemoryBuffer* memBuf = MemoryBuffer::getFile(filename, sizeof > filename, &errStr); > printf("errStr: %s\n", errStr.c_str()); > BitcodeReader::BitcodeReader bcReader(memBuf); > Module* Mod = bcReader.materializeModule(&errInfo); > printf("errInfo: %s\n", errInfo.c_str()); > > verifyModule(*Mod, PrintMessageAction); > > The errStr and the errInfo strings were empty, but I got a cras...