Mercurial > libavformat.hg
annotate barpainet.c @ 1332:7474cc6383d4 libavformat
fix some signedness warnings
author | mru |
---|---|
date | Wed, 27 Sep 2006 19:47:39 +0000 |
parents | 8bf9be9bb107 |
children | 0899bfe4105c |
rev | line source |
---|---|
1306
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
1 /* |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
2 * copyright (c) 2002 Francois Revol |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
3 * |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
4 * This library is free software; you can redistribute it and/or |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
5 * modify it under the terms of the GNU Lesser General Public |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
6 * License as published by the Free Software Foundation; either |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
7 * version 2 of the License, or (at your option) any later version. |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
8 * |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
9 * This library is distributed in the hope that it will be useful, |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
12 * Lesser General Public License for more details. |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
13 * |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
14 * You should have received a copy of the GNU Lesser General Public |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
15 * License along with this library; if not, write to the Free Software |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
8bf9be9bb107
Add official LGPL license headers to the files that were missing them.
diego
parents:
887
diff
changeset
|
17 */ |
0 | 18 |
19 #include <stdlib.h> | |
20 #include <strings.h> | |
21 #include "barpainet.h" | |
22 | |
23 int inet_aton (const char * str, struct in_addr * add) { | |
887 | 24 const char * pch = str; |
25 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; | |
885 | 26 |
887 | 27 add1 = atoi(pch); |
28 pch = strpbrk(pch,"."); | |
29 if (pch == 0 || ++pch == 0) goto done; | |
30 add2 = atoi(pch); | |
31 pch = strpbrk(pch,"."); | |
32 if (pch == 0 || ++pch == 0) goto done; | |
33 add3 = atoi(pch); | |
34 pch = strpbrk(pch,"."); | |
35 if (pch == 0 || ++pch == 0) goto done; | |
36 add4 = atoi(pch); | |
0 | 37 |
38 done: | |
887 | 39 add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1; |
885 | 40 |
887 | 41 return 1; |
0 | 42 } |