Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
454 B

  1. #ifdef __dietlibc__
  2. #include <sys/cdefs.h>
  3. #else
  4. #define __likely(x) x
  5. #define __unlikely(x) x
  6. #endif
  7. #include "safemult.h"
  8. #include "array.h"
  9. /* I'm not sure I understand what this function is good for */
  10. void array_truncate(array* x,uint64 membersize,int64 len) {
  11. uint64 wanted;
  12. if (__unlikely(len<0)) return;
  13. if (__unlikely(umult64(membersize,len,&wanted))) return;
  14. if (__unlikely(wanted > x->initialized)) return;
  15. x->initialized=wanted;
  16. }