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