MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / UnityPrintNumberHex

Function UnityPrintNumberHex

tests/unity/src/unity.c:210–230  ·  view source on GitHub ↗

-----------------------------------------------*/

Source from the content-addressed store, hash-verified

208
209/*-----------------------------------------------*/
210void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
211{
212 int nibble;
213 char nibbles = nibbles_to_print;
214 if ((unsigned)nibbles > (2 * sizeof(number)))
215 nibbles = 2 * sizeof(number);
216
217 while (nibbles > 0)
218 {
219 nibbles--;
220 nibble = (int)(number >> (nibbles * 4)) & 0x0F;
221 if (nibble <= 9)
222 {
223 UNITY_OUTPUT_CHAR((char)('0' + nibble));
224 }
225 else
226 {
227 UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble));
228 }
229 }
230}
231
232/*-----------------------------------------------*/
233void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number)

Callers 4

UnityPrintFunction · 0.85
UnityPrintLenFunction · 0.85
UnityPrintNumberByStyleFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…