Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 284) sorted by relevance

12345678910>>...12

/frameworks/native/libs/utils/
DTextOutput.cpp46 char buf[16]; in operator <<() local
47 sprintf(buf, "%d", val); in operator <<()
48 to.print(buf, strlen(buf)); in operator <<()
54 char buf[16]; in operator <<() local
55 sprintf(buf, "%ld", val); in operator <<()
56 to.print(buf, strlen(buf)); in operator <<()
62 char buf[16]; in operator <<() local
63 sprintf(buf, "%u", val); in operator <<()
64 to.print(buf, strlen(buf)); in operator <<()
70 char buf[16]; in operator <<() local
[all …]
DString8.cpp63 SharedBuffer* buf = SharedBuffer::alloc(1); in initialize_string8() local
64 char* str = (char*)buf->data(); in initialize_string8()
66 gEmptyStringBuf = buf; in initialize_string8()
82 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local
83 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8()
84 if (buf) { in allocFromUTF8()
85 char* str = (char*)buf->data(); in allocFromUTF8()
105 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF16() local
106 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
107 if (!buf) { in allocFromUTF16()
[all …]
DString16.cpp46 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)); in initialize_string16() local
47 char16_t* str = (char16_t*)buf->data(); in initialize_string16()
49 gEmptyStringBuf = buf; in initialize_string16()
75 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)*(u16len+1)); in allocFromUTF8() local
76 if (buf) { in allocFromUTF8()
78 char16_t* u16str = (char16_t*)buf->data(); in allocFromUTF8()
114 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16() local
115 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in String16()
116 if (buf) { in String16()
117 char16_t* str = (char16_t*)buf->data(); in String16()
[all …]
/frameworks/native/libs/utils/tests/
DBlobCache_test.cpp47 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local
49 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F()
50 ASSERT_EQ('e', buf[0]); in TEST_F()
51 ASSERT_EQ('f', buf[1]); in TEST_F()
52 ASSERT_EQ('g', buf[2]); in TEST_F()
53 ASSERT_EQ('h', buf[3]); in TEST_F()
57 char buf[2] = { 0xee, 0xee }; in TEST_F() local
60 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_F()
61 ASSERT_EQ('c', buf[0]); in TEST_F()
62 ASSERT_EQ('d', buf[1]); in TEST_F()
[all …]
/frameworks/native/libs/gui/tests/
DSurfaceTextureClient_test.cpp212 ANativeWindowBuffer* buf; in TEST_F() local
213 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F()
214 EXPECT_EQ(1, buf->width); in TEST_F()
215 EXPECT_EQ(1, buf->height); in TEST_F()
216 EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); in TEST_F()
217 ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); in TEST_F()
221 ANativeWindowBuffer* buf; in TEST_F() local
223 ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); in TEST_F()
224 EXPECT_EQ(16, buf->width); in TEST_F()
225 EXPECT_EQ(8, buf->height); in TEST_F()
[all …]
DCpuConsumer_test.cpp164 void checkPixel(const CpuConsumer::LockedBuffer &buf, in checkPixel() argument
167 switch(buf.format) { in checkPixel()
170 uint16_t *bPtr = (uint16_t*)buf.data; in checkPixel()
171 bPtr += y * buf.stride + x; in checkPixel()
189 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
190 bPtr += y * buf.stride + x; in checkPixel()
197 uint16_t *bPtr = ((uint16_t*)buf.data) + y * buf.stride + x; in checkPixel()
204 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
205 bPtr += (y * buf.stride + x) * bytesPerPixel; in checkPixel()
213 ADD_FAILURE() << "Unknown format for check:" << buf.format; in checkPixel()
[all …]
/frameworks/native/opengl/tests/EGLTest/
Degl_cache_test.cpp44 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local
46 ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4)); in TEST_F()
47 ASSERT_EQ(0xee, buf[0]); in TEST_F()
48 ASSERT_EQ(0xee, buf[1]); in TEST_F()
49 ASSERT_EQ(0xee, buf[2]); in TEST_F()
50 ASSERT_EQ(0xee, buf[3]); in TEST_F()
54 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local
57 ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4)); in TEST_F()
58 ASSERT_EQ('e', buf[0]); in TEST_F()
59 ASSERT_EQ('f', buf[1]); in TEST_F()
[all …]
/frameworks/base/core/jni/
Dandroid_server_Watchdog.cpp32 char buf[64]; in dumpOneStack() local
34 snprintf(buf, sizeof(buf), "/proc/%d/stack", tid); in dumpOneStack()
35 int stackFd = open(buf, O_RDONLY); in dumpOneStack()
38 strncat(buf, ":\n", sizeof(buf) - strlen(buf) - 1); in dumpOneStack()
39 write(outFd, buf, strlen(buf)); in dumpOneStack()
43 while ((nBytes = read(stackFd, buf, sizeof(buf))) > 0) { in dumpOneStack()
44 write(outFd, buf, nBytes); in dumpOneStack()
56 char buf[128]; in dumpKernelStacks() local
74 snprintf(buf, sizeof(buf), "\n----- begin pid %d kernel stacks -----\n", getpid()); in dumpKernelStacks()
75 write(outFd, buf, strlen(buf)); in dumpKernelStacks()
[all …]
Dandroid_os_SystemProperties.cpp35 char buf[PROPERTY_VALUE_MAX]; in SystemProperties_getSS() local
45 len = property_get(key, buf, ""); in SystemProperties_getSS()
49 rvJ = env->NewStringUTF(buf); in SystemProperties_getSS()
71 char buf[PROPERTY_VALUE_MAX]; in SystemProperties_get_int() local
82 len = property_get(key, buf, ""); in SystemProperties_get_int()
84 result = strtol(buf, &end, 0); in SystemProperties_get_int()
85 if (end == buf) { in SystemProperties_get_int()
101 char buf[PROPERTY_VALUE_MAX]; in SystemProperties_get_long() local
112 len = property_get(key, buf, ""); in SystemProperties_get_long()
114 result = strtoll(buf, &end, 0); in SystemProperties_get_long()
[all …]
DTime.cpp90 char buf[257]; in format() local
91 int n = strftime_tz(buf, 257, format, &(this->t), locale); in format()
93 return String8(buf); in format()
114 Time::format2445(short* buf, bool hasTime) const in format2445() argument
119 buf[0] = next_char(&n, 1000); in format2445()
120 buf[1] = next_char(&n, 100); in format2445()
121 buf[2] = next_char(&n, 10); in format2445()
122 buf[3] = tochar(n); in format2445()
125 buf[4] = next_char(&n, 10); in format2445()
126 buf[5] = tochar(n); in format2445()
[all …]
Dandroid_util_EventLog.cpp69 uint8_t buf[MAX_EVENT_PAYLOAD]; in android_util_EventLog_writeEvent_String() local
75 size_t max = sizeof(buf) - sizeof(len) - 2; // Type byte, final newline in android_util_EventLog_writeEvent_String()
78 buf[0] = EVENT_TYPE_STRING; in android_util_EventLog_writeEvent_String()
79 memcpy(&buf[1], &len, sizeof(len)); in android_util_EventLog_writeEvent_String()
80 memcpy(&buf[1 + sizeof(len)], str, len); in android_util_EventLog_writeEvent_String()
81 buf[1 + sizeof(len) + len] = '\n'; in android_util_EventLog_writeEvent_String()
84 return android_bWriteLog(tag, buf, 2 + sizeof(len) + len); in android_util_EventLog_writeEvent_String()
97 uint8_t buf[MAX_EVENT_PAYLOAD]; in android_util_EventLog_writeEvent_Array() local
98 const size_t max = sizeof(buf) - 1; // leave room for final newline in android_util_EventLog_writeEvent_Array()
109 buf[pos++] = EVENT_TYPE_STRING; in android_util_EventLog_writeEvent_Array()
[all …]
/frameworks/av/media/libstagefright/codecs/aacenc/src/asm/ARMV7/
DR4R8First_v7.s44 VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@i0 = buf[1] + buf[3]@
45 VSUB.S32 d5, d0, d1 @ r1 = buf[0] - buf[2]@i1 = buf[1] - buf[3]@
46 VSUB.S32 d7, d2, d3 @ r2 = buf[4] - buf[6]@i2 = buf[5] - buf[7]@
47 VADD.S32 d6, d2, d3 @ r3 = buf[4] + buf[6]@i3 = buf[5] + buf[7]@
55 VADD.S32 d4, d8, d9 @ r0 = buf[ 8] + buf[10]@i0 = buf[ 9] + buf[11]@
56 VSUB.S32 d7, d10, d11 @ r1 = buf[12] - buf[14]@i1 = buf[13] - buf[15]@
57 VADD.S32 d6, d10, d11 @ r2 = buf[12] + buf[14]@i2 = buf[13] + buf[15]@
59 VSUB.S32 d5, d8, d9 @ r3 = buf[ 8] - buf[10]@i3 = buf[ 9] - buf[11]@
134 VADD.S32 d4, d0, d1 @ r0 = buf[0] + buf[2]@ r1 = buf[1] + buf[3]@
135 VSUB.S32 d5, d0, d1 @ r2 = buf[0] - buf[2]@ r3 = buf[1] - buf[3]@
[all …]
/frameworks/av/media/libstagefright/codecs/aacenc/src/
Dtransform.c42 static void Shuffle(int *buf, int num, const unsigned char* bitTab) in Shuffle() argument
48 part0 = buf; in Shuffle()
49 part1 = buf + num; in Shuffle()
73 static void Radix4First(int *buf, int num) in Radix4First() argument
80 r0 = buf[0] + buf[2]; in Radix4First()
81 r1 = buf[1] + buf[3]; in Radix4First()
82 r2 = buf[0] - buf[2]; in Radix4First()
83 r3 = buf[1] - buf[3]; in Radix4First()
84 r4 = buf[4] + buf[6]; in Radix4First()
85 r5 = buf[5] + buf[7]; in Radix4First()
[all …]
/frameworks/base/core/java/android/net/dhcp/
DDhcpPacket.java251 InetAddress srcIp, short destUdp, short srcUdp, ByteBuffer buf, in fillInPacket() argument
262 buf.clear(); in fillInPacket()
263 buf.order(ByteOrder.BIG_ENDIAN); in fillInPacket()
270 buf.put(IP_VERSION_HEADER_LEN); in fillInPacket()
271 buf.put(IP_TOS_LOWDELAY); // tos: IPTOS_LOWDELAY in fillInPacket()
272 ipLengthOffset = buf.position(); in fillInPacket()
273 buf.putShort((short)0); // length in fillInPacket()
274 buf.putShort((short)0); // id in fillInPacket()
275 buf.putShort(IP_FLAGS_OFFSET); // ip offset: don't fragment in fillInPacket()
276 buf.put(IP_TTL); // TTL: use default 64 from RFC1340 in fillInPacket()
[all …]
/frameworks/base/tools/aapt/
DZipEntry.cpp405 unsigned char buf[kLFHLen]; in read() local
410 if (fread(buf, 1, kLFHLen, fp) != kLFHLen) { in read()
415 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { in read()
421 mVersionToExtract = ZipEntry::getShortLE(&buf[0x04]); in read()
422 mGPBitFlag = ZipEntry::getShortLE(&buf[0x06]); in read()
423 mCompressionMethod = ZipEntry::getShortLE(&buf[0x08]); in read()
424 mLastModFileTime = ZipEntry::getShortLE(&buf[0x0a]); in read()
425 mLastModFileDate = ZipEntry::getShortLE(&buf[0x0c]); in read()
426 mCRC32 = ZipEntry::getLongLE(&buf[0x0e]); in read()
427 mCompressedSize = ZipEntry::getLongLE(&buf[0x12]); in read()
[all …]
DZipEntry.h116 static inline unsigned short getShortLE(const unsigned char* buf) { in getShortLE() argument
117 return buf[0] | (buf[1] << 8); in getShortLE()
119 static inline unsigned long getLongLE(const unsigned char* buf) { in getLongLE() argument
120 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); in getLongLE()
122 static inline void putShortLE(unsigned char* buf, short val) { in putShortLE() argument
123 buf[0] = (unsigned char) val; in putShortLE()
124 buf[1] = (unsigned char) (val >> 8); in putShortLE()
126 static inline void putLongLE(unsigned char* buf, long val) { in putLongLE() argument
127 buf[0] = (unsigned char) val; in putLongLE()
128 buf[1] = (unsigned char) (val >> 8); in putLongLE()
[all …]
/frameworks/volley/src/com/android/volley/toolbox/
DByteArrayPool.java93 byte[] buf = mBuffersBySize.get(i); in getBuf()
94 if (buf.length >= len) { in getBuf()
95 mCurrentSize -= buf.length; in getBuf()
97 mBuffersByLastUse.remove(buf); in getBuf()
98 return buf; in getBuf()
110 public synchronized void returnBuf(byte[] buf) { in returnBuf() argument
111 if (buf == null || buf.length > mSizeLimit) { in returnBuf()
114 mBuffersByLastUse.add(buf); in returnBuf()
115 int pos = Collections.binarySearch(mBuffersBySize, buf, BUF_COMPARATOR); in returnBuf()
119 mBuffersBySize.add(pos, buf); in returnBuf()
[all …]
/frameworks/compile/libbcc/include/bcinfo/Wrap/
DBCHeaderField.h48 bool Write(uint8_t* buf, size_t buf_len) { in Write() argument
57 WriteFixedSubfield(static_cast<FixedSubfield>(ID_), buf); in Write()
59 buf + sizeof(FixedSubfield)); in Write()
60 memcpy(buf + kTagLenSize, data_, len_); in Write()
63 memset(buf + fields_len, 0, pad_len); in Write()
68 bool Read(const uint8_t* buf, size_t buf_len) { in Read() argument
71 ReadFixedSubfield(&field, buf); in Read()
73 ReadFixedSubfield(&field, buf + sizeof(FixedSubfield)); in Read()
76 memcpy(data_, buf + kTagLenSize, len_); in Read()
89 static size_t GetDataSizeFromSerialized(const uint8_t* buf) { in GetDataSizeFromSerialized() argument
[all …]
/frameworks/native/libs/gui/
DBufferQueue.cpp232 status_t BufferQueue::requestBuffer(int slot, sp<GraphicBuffer>* buf) { in requestBuffer() argument
254 *buf = mSlots[slot].mGraphicBuffer; in requestBuffer()
364 const int buf = found; in dequeueBuffer() local
367 ATRACE_BUFFER_INDEX(buf); in dequeueBuffer()
376 mSlots[buf].mBufferState = BufferSlot::DEQUEUED; in dequeueBuffer()
378 const sp<GraphicBuffer>& buffer(mSlots[buf].mGraphicBuffer); in dequeueBuffer()
385 mSlots[buf].mAcquireCalled = false; in dequeueBuffer()
386 mSlots[buf].mGraphicBuffer = NULL; in dequeueBuffer()
387 mSlots[buf].mRequestBufferCalled = false; in dequeueBuffer()
388 mSlots[buf].mEglFence = EGL_NO_SYNC_KHR; in dequeueBuffer()
[all …]
/frameworks/base/tests/touchlag/
Dtouchlag.cpp50 void clearBuffer(Buffer* buf, uint32_t pixel) { in clearBuffer() argument
51 android_memset32(buf->pixels, pixel, buf->s * buf->h * 4); in clearBuffer()
54 void drawTwoPixels(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) { in drawTwoPixels() argument
55 if (y>0 && y<ssize_t(buf->h)) { in drawTwoPixels()
56 uint32_t* bits = buf->pixels + y * buf->s; in drawTwoPixels()
57 if (x>=0 && x<buf->w) { in drawTwoPixels()
61 if ((x+W)>=0 && (x+W)<buf->w) { in drawTwoPixels()
67 void drawHLine(Buffer* buf, uint32_t pixel, ssize_t x, ssize_t y, size_t w) { in drawHLine() argument
68 if (y>0 && y<ssize_t(buf->h)) { in drawHLine()
74 if (x+w > buf->w) { in drawHLine()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/
DResponseData.java36 public abstract void format(ByteArrayOutputStream buf); in format() argument
38 public static void writeLength(ByteArrayOutputStream buf, int length) { in writeLength() argument
43 buf.write(0x81); in writeLength()
45 buf.write(length); in writeLength()
59 public void format(ByteArrayOutputStream buf) { in format() argument
62 buf.write(tag); // tag in format()
63 buf.write(1); // length in format()
64 buf.write(mId); // identifier of item chosen in format()
98 public void format(ByteArrayOutputStream buf) { in format() argument
99 if (buf == null) { in format()
[all …]
/frameworks/av/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/
DR4R8First_v5.s95 add r8, r0, r2 @ r0 = buf[0] + buf[2]@
96 add r9, r1, r3 @ i0 = buf[1] + buf[3]@
98 sub r0, r0, r2 @ r1 = buf[0] - buf[2]@
99 sub r1, r1, r3 @ i1 = buf[1] - buf[3]@
101 add r2, r4, r6 @ r2 = buf[4] + buf[6]@
102 add r3, r5, r7 @ i2 = buf[5] + buf[7]@
104 sub r4, r4, r6 @ r3 = buf[4] - buf[6]@
105 sub r5, r5, r7 @ i3 = buf[5] - buf[7]@
148 add r0, r2, r4 @ r0 = buf[ 8] + buf[10]@
149 add r1, r3, r5 @ i0 = buf[ 9] + buf[11]@
[all …]
/frameworks/rs/driver/linkloader/lib/
DMemChunk.cpp40 MemChunk::MemChunk() : buf((unsigned char *)MAP_FAILED), buf_size(0) { in MemChunk()
44 if (buf != MAP_FAILED) { in ~MemChunk()
45 munmap(buf, buf_size); in ~MemChunk()
54 buf = (unsigned char *)mmap((void *)StartAddr, size, in allocate()
59 buf = (unsigned char *)mmap(0, size, in allocate()
65 if (buf == MAP_FAILED) { in allocate()
78 if (buf != MAP_FAILED) { in print()
79 dump_hex(buf, buf_size, 0, buf_size); in print()
85 int ret = mprotect((void *)buf, buf_size, prot); in protect()
92 FLUSH_CPU_CACHE(buf, buf + buf_size); in protect()
/frameworks/base/core/tests/coretests/src/android/content/
DMemoryFileProviderTest.java39 byte[] buf = new byte[MemoryFileProvider.TEST_BLOB.length]; in testRead()
42 int count = in.read(buf); in testRead()
43 assertEquals(buf.length, count); in testRead()
46 assertTrue(Arrays.equals(MemoryFileProvider.TEST_BLOB, buf)); in testRead()
59 byte[] buf = new byte[MemoryFileProvider.TEST_BLOB.length]; in testClose()
60 int count = in.read(buf); in testClose()
61 assertEquals(buf.length, count); in testClose()
62 assertTrue(Arrays.equals(MemoryFileProvider.TEST_BLOB, buf)); in testClose()
72 byte[] buf = new byte[MemoryFileProvider.TEST_BLOB.length]; in testFile()
75 int count = in.read(buf); in testFile()
[all …]
/frameworks/base/services/jni/
Dcom_android_server_BatteryService.cpp145 static int readFromFile(const String8& path, char* buf, size_t size) in readFromFile() argument
155 ssize_t count = read(fd, buf, size); in readFromFile()
157 while (count > 0 && buf[count-1] == '\n') in readFromFile()
159 buf[count] = '\0'; in readFromFile()
161 buf[0] = '\0'; in readFromFile()
171 char buf[SIZE]; in setBooleanField() local
174 if (readFromFile(path, buf, SIZE) > 0) { in setBooleanField()
175 if (buf[0] != '0') { in setBooleanField()
185 char buf[SIZE]; in setIntField() local
188 if (readFromFile(path, buf, SIZE) > 0) { in setIntField()
[all …]

12345678910>>...12