computer






 

Question by  Qadoc (37)

How do you replace a bit shift to avoid a linux bug?

I am trying to eliminate the chances of getting a linux bug by replacing my bit shift.

 
+7

Answer by  Mark94 (127)

Bit shifts are used to access raw bits inside of common data types. The information being accessed with bit shifts can always be accessed through more indirect methods. Replace the bit shifts by operating on memory in a more conventional manor.

 
+4

Answer by  gheesh (59)

You may replace all right bit shifts with divisions by powers of 2 and all left shifts with multiplications. For example, to right shift 3 bits divide the number by 8 (2^3) and to shift right multiply by the same amount.

 
+4

Answer by  murali680 (559)

These types of information being accepted with bit shift which can always be accessed through many indirect types. More bit shifts are used to access raw bits within of general data file. By operating on memory we can replace the bit shifts in a most conventional manner also handle both byte and UTF8 string.

 
+4

Answer by  mahes (32209)

Requirements: should handle both byte and UTF8 strings. isPRINT() characters printed as-is, character less than 256 as \xHH, Unicode characters as \x{HHH}. Don't assume ASCII-like, either, get somebody on EBCDIC to test the output.

 
+2

Answer by  siva15 (492)

Cosmetic tweak to millisecond/microsecond loop to pipe a here document in to "while read". (Previous version had a for loop parsing arguments with spaces via "cut" which prompted ).

 
You have 50 words left!