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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
19 #include <stdlib.h>
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20 #include <strings.h>
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
21 #include "barpainet.h"
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
23 int inet_aton (const char * str, struct in_addr * add) {
887
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
24 const char * pch = str;
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
25 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 0
diff changeset
26
887
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
27 add1 = atoi(pch);
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
28 pch = strpbrk(pch,".");
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
29 if (pch == 0 || ++pch == 0) goto done;
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
30 add2 = atoi(pch);
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
31 pch = strpbrk(pch,".");
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
32 if (pch == 0 || ++pch == 0) goto done;
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
33 add3 = atoi(pch);
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
34 pch = strpbrk(pch,".");
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
35 if (pch == 0 || ++pch == 0) goto done;
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
36 add4 = atoi(pch);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
37
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
38 done:
887
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
39 add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 0
diff changeset
40
887
d70e50f1495f COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 885
diff changeset
41 return 1;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
42 }