Home | History | Annotate | Download | only in Linux_x86
      1 /*
      2  * Copyright (C) 2010 NXP Semiconductors
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /**
     18  * \file  phOsalNfc_Utils.c
     19  * \brief OSAL Implementation.
     20  *
     21  * Project: NFC-FRI 1.1
     22  *
     23  * $Date: Wed Jun 24 10:35:10 2009 $
     24  * $Author: ravindrau $
     25  * $Revision: 1.1 $
     26  * $Aliases: NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
     27  *
     28  */
     29 
     30 #include <phNfcStatus.h>
     31 #include <phNfcCompId.h>
     32 #include <phNfcConfig.h>
     33 #include <phOsalNfc.h>
     34 
     35 
     36 /*The function does a comparison of two strings and returns a non zero value
     37 if two strings are unequal*/
     38 int phOsalNfc_MemCompare ( void *src, void *dest, unsigned int n )
     39 {
     40     int8_t *b1  =(int8_t *)src;
     41     int8_t *b2  =(int8_t *)dest;
     42     int8_t   diff = 0;
     43 #ifdef VERIFY_MEMORY
     44     if((NULL != src) && (NULL != dest))
     45 #endif
     46     {
     47         for(;((n>0)&&(diff==0));n--,b1++,b2++)
     48         {
     49             diff = *b1 - *b2;
     50         }
     51     }
     52     return (int)diff;
     53 }
     54 
     55 
     56 
     57 
     58