endianness Questions

4

I have a PostgreSQL table that I want to alter a column from bigint to bytea byte to hold more data. I am thinking using the following sequence: alter table mytable add new_column update mytable ...
Greensward asked 21/6, 2012 at 16:6

4

Solved

I have an array char c[12] = {'a','b','c','d','e','f','g','h','0','1','2','3'} In hexadecimal these values would be {0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x30, 0x31, 0x32, 0x33} What I ...
Feathered asked 20/10, 2014 at 0:7

2

Solved

I am inquiring about how to tell when one element in an array has finished and another is beginning in an endian architecture. I have 2 arrays where the size of long is 8 and the size of char is 1 ...
Dickinson asked 19/10, 2014 at 21:56

3

Solved

The title says it all. I want to know whether an x86 instruction that reads data from memory, translates its bytes or its bits to the Little-Endian order. For example if we have the following data ...
Fiden asked 19/9, 2014 at 16:41

6

Solved

So I'm writing a program to test the endianess of a machine and print it. I understand the difference between little and big endian, however, from what I've found online, I don't understand why the...
Lavernelaverock asked 2/4, 2012 at 5:39

4

Solved

Many implementations of htonl() or ntohl() test for the endianness of the platform first and then return a function which is either a no-op or a byte-swap. I once read a page on the web about a few...
Rambling asked 3/9, 2014 at 9:42

2

Solved

I'm trying to get my head around endianess and bit ordering. EDIT: As pointed out in the comments, the endianess doesn't concern my problem, but I like to have it put up here just for completeness...
Cannonade asked 12/8, 2014 at 9:54

3

Solved

In the Plan 9 source code I often find code like this to read serialised data from a buffer with a well-defined endianess: #include <stdint.h> uint32_t le32read(uint8_t buf[static 4]) { re...
Doggery asked 9/8, 2014 at 14:33

7

Solved

I was so happy when I discovered IsLittleEndian field in BitConverter. I thought of course it should be there and I should be able to specify whatever endian I like. Well, my happiness didn’t last ...
Everywhere asked 20/6, 2011 at 3:28

5

My task is to convert a data file from big endian to little endian & vice versa using C. I have been looking online for about 3 hours now for other examples and reading my text book, howe...
Lodging asked 21/7, 2014 at 2:14

2

Solved

In C# I can get the endianness type by this code snippet: if(BitConverter.IsLittleEndian) { // little-endian is used } else { // big-endian is used } How can I do the same in PHP?
Sinuation asked 16/3, 2012 at 21:46

2

Solved

I have a slice of bytes (which I know that are an integer saved as little endian) and I want to convert them to an integer. When I had a static-sized array it was no problem, but now I have a slic...
Liggitt asked 3/6, 2014 at 12:34

2

Solved

I have doubts about which order of the parameters size and count to use for fread/fwrite. If I want to read 8kb of data from file fp, which of the following is more efficient? fread(data,1,8...
Toggle asked 16/10, 2013 at 17:46

1

Since the sk_buff fields are processed locally it makes more sense to store it in the host order. Fields like sk_buff->vlan_tci are in host order. Is there a reason for storing some fields sk_bu...

1

Solved

I have the following code, which writes 6 floats to disk in binary form and reads them back: #include <iostream> #include <cstdio> int main() { int numSegs = 2; int numVars = 3; f...
Sulk asked 21/3, 2014 at 19:20

2

Solved

I'm having troubles wrapping my head on the two. I understand how to represent something in big endian. For example -12 is 1111 1111 1111 0100 But why is the little endian representation 1111 010...
Xantha asked 26/2, 2014 at 2:42

3

Solved

I've recently been working on a system that needs to store and load large quantities of data, including single-precision floating-point values. I decided to standardise on network byte order for in...
Archimedes asked 16/5, 2012 at 14:22

3

Solved

__builtin_bswap32() is used to reverse bytes (it's used for littel/big endian issues (from gcc)). htonl() is used to reverse bytes too (conversion from host to network). I checked both functions ...
Burkholder asked 3/2, 2014 at 12:53

3

Solved

Suppose I have unsigned long long x = 0x0123456789ABCDEF. Which of the following is correct? (I can verify only the first one): On a 32-bit little-endian processor, it will appear in memory as 6...
Dionnadionne asked 31/1, 2014 at 11:16

2

Solved

Could somebody tell me how to convert double precision into network byte ordering. I tried uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong);...
Millian asked 16/5, 2012 at 10:42

2

Literally confused about htonl(). In so many links I found that code to do htonl is : #define HTONL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \ ((((unsigned long)(n) & 0xFF00)) &l...
Dentelle asked 23/1, 2014 at 14:47

3

Solved

Sometimes GCC generates this instruction when compiling with -march=atom. Does each and every Intel Atom CPU support MOVBE? What other processors support this instruction? I can't seem to find th...
Zwart asked 9/3, 2011 at 13:0

4

Solved

I have a system where a remote agent sends serialized structures (from an embedded C system) for me to read and store via IP/UDP. In some cases I need to send back the same structure types. I thoug...
Transferor asked 12/4, 2010 at 16:49

3

Solved

We recently had a lecture in university about programming specials in several languages. The lecturer wrote down the following function: inline u64 Swap_64(u64 x) { u64 tmp; (*(u32*)&tmp) =...
Planetarium asked 4/1, 2014 at 15:8

4

Solved

I'm working on a program where I store some data in an integer and process it bitwise. For example, I might receive the number 48, which I will process bit-by-bit. In general the endianness of inte...
Comate asked 9/9, 2009 at 14:20

© 2022 - 2024 — McMap. All rights reserved.