search for: clen

Displaying 20 results from an estimated 59 matches for "clen".

Did you mean: clean
2007 Jun 24
2
problem gsub in the locale of CP932 and SJIS (PR#9751)
...2007-04-03 11:05:05.000000000 +0900 +++ R-2.5.0/src/main/character.c 2007-06-24 22:31:06.000000000 +0900 @@ -986,6 +986,17 @@ char *p = repl; n = strlen(repl) - (regmatch[0].rm_eo - regmatch[0].rm_so); while (*p) { +#ifdef SUPPORT_MBCS + if(mbcslocale){ + int clen; + mbstate_t mb_st; + mbs_init(&mb_st); + if((clen = Mbrtowc(NULL, p, MB_CUR_MAX, &mb_st)) > 1){ + p+=clen; + continue; + } + } +#endif if (*p == '\\') { if ('1' <= p[1] &...
2010 Apr 27
4
Patch sensible callback framework
...,7 @@ #include <fcntl.h> #include <sys/stat.h> +#include <syslinux/callback.h> #include <syslinux/loadfile.h> #define INCREMENTAL_CHUNK 1024*1024 @@ -48,13 +49,13 @@ int floadfile(FILE * f, void **ptr, size struct stat st; void *data, *dp; size_t alen, clen, rlen, xlen; + callback_record *cb = NULL; clen = alen = 0; data = NULL; if (fstat(fileno(f), &st)) goto err; - if (!S_ISREG(st.st_mode)) { /* Not a regular file, we can't assume we know the file size */ if (prefix_len) { @@ -75,6 +76,11 @@ int floadfile(FIL...
2023 Apr 06
3
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...on_map *resmap, { struct rb_root *root = &resmap->m_reservations; unsigned int gap_start, gap_end, gap_len; - struct ocfs2_alloc_reservation *prev_resv, *next_resv; + struct ocfs2_alloc_reservation *prev_resv, *next_resv, *best_resv; struct rb_node *prev, *next; unsigned int cstart, clen; unsigned int best_start = 0, best_len = 0; + int create_new = 0; /* * Nasty cases to consider: @@ -540,8 +541,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap, if (clen) { best_len = clen; best_start = cstart; + create_new = 1; if (best_len =...
2023 Apr 29
1
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...;resmap->m_reservations; >> unsigned int gap_start, gap_end, gap_len; >> - struct ocfs2_alloc_reservation *prev_resv, *next_resv; >> + struct ocfs2_alloc_reservation *prev_resv, *next_resv, *best_resv; >> struct rb_node *prev, *next; >> unsigned int cstart, clen; >> unsigned int best_start = 0, best_len = 0; >> + int create_new = 0; >> >> /* >> * Nasty cases to consider: >> @@ -540,8 +541,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap, >> if (clen) { >> be...
2011 Aug 04
1
slightly speeding up readChar()
...ld pointer is used (?). In any case, here is an updated readFixedString(), which would drop 2 O(N) operations. --- static SEXP readFixedString(Rconnection con, int len, int useBytes) { SEXP ans; char *buf; int m; const void *vmax = vmaxget(); if(utf8locale && !useBytes) { int i, clen; char *p, *q; p = buf = (char *) R_alloc(MB_CUR_MAX*len+1, sizeof(char)); memset(buf, 0, MB_CUR_MAX*len+1); for(i = 0; i < len; i++) { q = p; m = con->read(p, sizeof(char), 1, con); if(!m) { if(i == 0) return R_NilValue; else break;} clen = utf8clen(*p++); if(clen >...
2023 Apr 21
2
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...ct rb_root *root = &resmap->m_reservations; > unsigned int gap_start, gap_end, gap_len; > - struct ocfs2_alloc_reservation *prev_resv, *next_resv; > + struct ocfs2_alloc_reservation *prev_resv, *next_resv, *best_resv; > struct rb_node *prev, *next; > unsigned int cstart, clen; > unsigned int best_start = 0, best_len = 0; > + int create_new = 0; > > /* > * Nasty cases to consider: > @@ -540,8 +541,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap, > if (clen) { > best_len = clen; > best_start = c...
2010 Apr 23
1
Path simple menu integrated progress indicator
...rr: free(data); return -1; } + +int floadfile_w_callback(FILE *f, void **ptr, size_t *len, const void *prefix, + size_t prefix_len, const char *filename, void (*callback)(const char *name, size_t cur, size_t total)) +{ + struct stat st; + void *data, *dp; + size_t alen, clen, rlen, xlen, flen; + + clen = alen = 0; + data = NULL; + + if ( fstat(fileno(f), &st) ) + goto err; + + + if (!S_ISREG(st.st_mode)) { + /* Not a regular file, we can't assume we know the file size */ + flen = -1; + } + else { + flen = st.st_size + prefix_len - ftell(f); +...
2012 Oct 12
9
[PATCH] Fits: tool to parse stream
...printf("bad magic\n"); + goto out; + } + if (read32(&h.version) != BTRFS_SEND_STREAM_VERSION) { + printf("invalid version %d\n", read32(&h.version)); + goto out; + } + printf("stream header, version %d\n", read32(&h.version)); + + while (1) { + uint32_t clen; + uint32_t crc_is; + uint32_t crc_should; + uint32_t c; + + ret = do_read(&cmd, sizeof(cmd)); + if (ret == 1) + break; + if (ret) { + printf("failed to read command header\n"); + goto out; + } + clen = read32(&cmd.len); + if (clen > sizeof(buf)) { + printf(&q...
2011 May 19
3
SEEK_DATA/HOLE on ocfs2 - v2
Two patches follow this message. One fixes the default implementation of SEEK_HOLE/DATA. This patch applies atop Josef's last posted patch. The second patch implements the same on ocfs2. The test tool for the same is available here. http://oss.oracle.com/~smushran/seek_data/seek_test.c It is improved since the last post. It runs cleanly on zfs, ocfs2 and ext3 (default behavior). Users
2011 May 19
3
SEEK_DATA/HOLE on ocfs2 - v2
Two patches follow this message. One fixes the default implementation of SEEK_HOLE/DATA. This patch applies atop Josef's last posted patch. The second patch implements the same on ocfs2. The test tool for the same is available here. http://oss.oracle.com/~smushran/seek_data/seek_test.c It is improved since the last post. It runs cleanly on zfs, ocfs2 and ext3 (default behavior). Users
2019 Jul 09
0
[PATCH] core: Add support for BLS Type 1 entries
...d = refstrdup(skipspace(p + 10)); + } else if (looking_at(p, "linux")) { + refstr_put(bd->freax); + bd->freax = refstrdup(skipspace(p + 5)); + } else if (looking_at(p, "initrd")) { + /* The "initrd" keyword can be specified multiple times */ + int clen = 0; + int xlen = 0; + + p = skipspace(p + 6); + xlen = strlen(p); + + if (xlen) { + if (bd->initrd) { + clen = strlen(bd->initrd); + bd->initrd[clen++] = ','; + } + bd->initrd = realloc(bd->initrd, clen + xlen + 1); + memcpy(bd->initrd + clen...
2006 May 30
2
Mongrel Bug
Mongrel''s tempfile generation on win32 is broken meaning large files can''t be uploaded. On line 198 of mongrel.rb (0.13.3) HttpRequest#initialize the tempfile function is called:       if clen &gt; Const::MAX_BODY         @body = Tempfile.new(self.class.name)         @body.binmode       else Unfortunately this also includes the module name as the example shows: Mongrel::HttpRequest2496.9 Win32 doesn''t allow the '':'' character in file names so this fail...
2002 Aug 12
1
question about cloud() in lattice package
Hi all, I have been previously been using scatterplot3d package to create some graphs but unfortunately it does not allow me to rotate the plot on all three axis. The cloud() function in the lattice package does allow me to do so. When I was using scatterplot3d I was using a script (Shown Below) to calculate the mean, quartiles and range limits for all three axis and I was representing that on the
2010 Jul 23
1
Sending files from mobile to CentOS via Bluetooth
...sm 1 scid 0x0040 < ACL data: handle 11 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0 Connection successful > HCI Event: Max Slots Change (0x1b) plen 3 > ACL data: handle 11 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0 < ACL data: handle 11 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0 Success < ACL data: handle 11 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0 > ACL data: handle 11 flags 0x02 dlen 14 L2CAP(s): Config rsp: sci...
2009 Jun 22
2
[LLVMdev] Getting Circular dependancy between libLLVMAlphaAsmPrinter.a and libLLVMAlphaCodeGen.a
Strange, seems to be working now on Linux, I had checkedout and used a clen build tree. Sorry for the noise. Aaron 2009/6/22 Anton Korobeynikov <anton at korobeynikov.info> > > Still not working, what does TOT stand for ? > Top Of the Tree. Works for me and Duncan also confirmed that it works > for him. Try to clean your build directory. > > -...
2004 Aug 06
2
C++ wrapper for speex
...LPWAVEHDR lpHdr = (LPWAVEHDR) lParam; int buflen = lpHdr->dwBufferLength; //160 float * buf = toFloat(lpHdr->lpData, buflen); // Encode some audio int nRet = enc.encode(buf, buflen); unsigned char *compressed = enc.getOutput(); int clen = enc.getOutputLength(); int speechDetected = enc.getSpeechDetected(); // delete temporary float buffer delete []buf; // Decode it int decodedSamples = dec.decode(compressed, clen); // Prepare decoded data for WAV B...
2007 Mar 24
0
max upload size!
...he specified content-length is higher than 200 MB (by default). I don''t know the behaviour if the specified content length is different than the actual uploaded data or if no content-length is given and chucked uploads are used. I wanted to fix this by using the request_progress(params, clen, total) method but clen represents the number of bytes that still have to come in, not the number of received bytes. How does mongrel deal with uploads when it does not know the total content length? And my second question: Zed suggests in his post "and then attach that to the front of your...
2009 Jun 23
0
[LLVMdev] Getting Circular dependancy between libLLVMAlphaAsmPrinter.a and libLLVMAlphaCodeGen.a
...l Message ----- From: Aaron Gray To: LLVM Developers Mailing List Sent: Tuesday, June 23, 2009 12:11 AM Subject: Re: [LLVMdev] Getting Circular dependancy between libLLVMAlphaAsmPrinter.a and libLLVMAlphaCodeGen.a Strange, seems to be working now on Linux, I had checkedout and used a clen build tree. Sorry for the noise. Aaron 2009/6/22 Anton Korobeynikov <anton at korobeynikov.info> > Still not working, what does TOT stand for ? Top Of the Tree. Works for me and Duncan also confirmed that it works for him. Try to clean your build directory....
2004 Aug 06
0
C++ wrapper for speex
...VAD: // buf is float[] or short int[], buflen is multiple of frame size // (there is a getFrameSize() method for both classes) // Encode some audio tgAudioEncoder enc(16000); // you could do 8000 instead enc.enableVAD(1); enc.encode(buf, buflen); unsigned char *compressed = enc.getOutput(); int clen = enc.getOutputLen(); int speechDetected = enc.getSpeechDetected(); // Decode it tgAudioDecoder dec(16000); int decodedSamples = dec.decode(compressed, clen); memcpy(buf, dec.getOutput(), decodedSamples * sizeof(short int)); Anyway, that's the basic idea. I don't think it could get much...
2004 Aug 06
1
C++ wrapper for speex
...{ > LPWAVEHDR lpHdr = (LPWAVEHDR) lParam; > > int buflen = lpHdr->dwBufferLength; //160 > float * buf = toFloat(lpHdr->lpData, buflen); > > // Encode some audio > int nRet = enc.encode(buf, buflen); > unsigned char *compressed = enc.getOutput(); > int clen = enc.getOutputLength(); > int speechDetected = enc.getSpeechDetected(); > > // delete temporary float buffer > delete []buf; > > // Decode it > int decodedSamples = dec.decode(compressed, clen); > > // Prepare decoded data for WAV > BYTE pSound =...