src/ucx.c

changeset 390
d345541018fa
parent 389
92e482410453
child 391
f094a53c1178
     1.1 --- a/src/ucx.c	Mon Dec 30 09:54:10 2019 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,62 +0,0 @@
     1.4 -/**
     1.5 - * @mainpage UAP Common Extensions
     1.6 - * Library with common and useful functions, macros and data structures.
     1.7 - * <p>
     1.8 - * Latest available source:<br>
     1.9 - * <a href="https://sourceforge.net/projects/ucx/files/">
    1.10 - * https://sourceforge.net/projects/ucx/files/</a>
    1.11 - * </p>
    1.12 - * 
    1.13 - * <p>
    1.14 - * Repositories:<br>
    1.15 - * <a href="https://sourceforge.net/p/ucx/code">
    1.16 - * https://sourceforge.net/p/ucx/code</a>
    1.17 - * -&nbsp;or&nbsp;-
    1.18 - * <a href="https://develop.uap-core.de/hg/ucx">
    1.19 - * https://develop.uap-core.de/hg/ucx</a>
    1.20 - * </p>
    1.21 - * 
    1.22 - * <h2>LICENCE</h2>
    1.23 - * 
    1.24 - * Copyright 2017 Mike Becker, Olaf Wintermann All rights reserved.
    1.25 - *
    1.26 - * Redistribution and use in source and binary forms, with or without
    1.27 - * modification, are permitted provided that the following conditions are met:
    1.28 - *
    1.29 - *   1. Redistributions of source code must retain the above copyright
    1.30 - *      notice, this list of conditions and the following disclaimer.
    1.31 - *
    1.32 - *   2. Redistributions in binary form must reproduce the above copyright
    1.33 - *      notice, this list of conditions and the following disclaimer in the
    1.34 - *      documentation and/or other materials provided with the distribution.
    1.35 - *
    1.36 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1.37 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.38 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.39 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    1.40 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    1.41 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    1.42 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    1.43 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    1.44 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    1.45 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    1.46 - * POSSIBILITY OF SUCH DAMAGE.
    1.47 - */
    1.48 -
    1.49 -#include "ucx/ucx.h"
    1.50 -
    1.51 -int ucx_szmul_impl(size_t a, size_t b, size_t *result) {
    1.52 -    if(a == 0 || b == 0) {
    1.53 -        *result = 0;
    1.54 -        return 0;
    1.55 -    }
    1.56 -    size_t r = a * b;
    1.57 -    if(r / b == a) {
    1.58 -        *result = r;
    1.59 -        return 0;
    1.60 -    } else {
    1.61 -        *result = 0;
    1.62 -        return 1;
    1.63 -    }
    1.64 -}
    1.65 -

mercurial