Subversion Repositories tendra.SVN

Rev

Rev 5 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 65... Line 95...
65
   true if it does or might overlap.
95
   true if it does or might overlap.
66
   only used by move, so we can assume
96
   only used by move, so we can assume
67
   that w1 and w2 are addressable.
97
   that w1 and w2 are addressable.
68
*/
98
*/
69
int might_overlap
99
int might_overlap
70
    PROTO_N ( (sha, w1, w2) )
-
 
71
    PROTO_T ( shape sha X where w1 X where w2 )
100
(shape sha, where w1, where w2)
72
{
101
{
73
  exp e1 = w1.where_exp;
102
  exp e1 = w1.where_exp;
74
  exp e2 = w2.where_exp;
103
  exp e2 = w2.where_exp;
75
  exp i1, i2;
104
  exp i1, i2;
76
  int off1, off2, sz;
105
  int off1, off2, sz;
77
 
106
 
78
  if (name(e1) != name_tag) {
107
  if (name(e1)!= name_tag) {
79
    if (name(e2) == name_tag && iscaonly(son(e2)))
108
    if (name(e2) == name_tag && iscaonly(son(e2)))
80
      return 0;
109
      return 0;
81
    return 1;
110
    return 1;
82
  };
111
  };
83
 
112
 
84
  if (name(e2) != name_tag) {
113
  if (name(e2)!= name_tag) {
85
    if (name(e1) == name_tag && iscaonly(son(e1)))
114
    if (name(e1) == name_tag && iscaonly(son(e1)))
86
      return 0;
115
      return 0;
87
    return 1;
116
    return 1;
88
  };
117
  };
89
 
118
 
Line 104... Line 133...
104
  };
133
  };
105
  if (isglob(i2))
134
  if (isglob(i2))
106
    return 0;
135
    return 0;
107
 
136
 
108
	/* both are local */
137
	/* both are local */
109
  if (ptno(i1) != ptno(i2))
138
  if (ptno(i1)!= ptno(i2))
110
    return 0;
139
    return 0;
111
 
140
 
112
  sz = shape_size(sha);
141
  sz = shape_size(sha);
113
  off1 = no(e1) + no(i1) + w1.where_off;
142
  off1 = no(e1) + no(i1) + w1.where_off;
114
  off2 = no(e2) + no(i2) + w2.where_off;
143
  off2 = no(e2) + no(i2) + w2.where_off;