Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ethspam by
util.h
00001 #ifndef UTIL_H 00002 #define UTIL_H 00003 00004 #include "types.h" 00005 00006 /** 00007 \file util.h 00008 \brief Primary utility header 00009 00010 In addition to providing some utility functions, this file also includes 00011 the other utility headers automatically. 00012 */ 00013 00014 /// Is any byte memory at start for bytes nonzero? 00015 inline bool is_nonzero_mem(u8 *start, unsigned int bytes) 00016 { 00017 for (; bytes--; ++start) if (*start) return true; 00018 return false; 00019 } 00020 00021 /// Are all bytes at start for bytes zero? 00022 inline bool is_zero_mem(u8 *start, unsigned int bytes) 00023 { 00024 for (; bytes--; ++start) if (*start) return false; 00025 return true; 00026 } 00027 00028 /// Are the memory locations at and and b equal for bytes? 00029 inline bool is_equal_mem(u8 *a, u8 *b, unsigned int bytes) 00030 { 00031 for (; bytes--; ++a, ++b) if (*a != *b) return false; 00032 return true; 00033 } 00034 00035 #endif
Generated on Fri Jul 15 2022 02:45:18 by
1.7.2
