X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tools%2Fnesc_nx.h;h=d269bc5f570f525522434e9e3d63f1da44c11b49;hb=627b462e8421954b5102d839ff203adb3400a8cc;hp=2109d337b4cf18795610f029d067d3431d561d60;hpb=57d4530c4d6814fa25338a00cc65b95938c723b6;p=nesc.git diff --git a/tools/nesc_nx.h b/tools/nesc_nx.h index 2109d33..d269bc5 100644 --- a/tools/nesc_nx.h +++ b/tools/nesc_nx.h @@ -1,15 +1,61 @@ -/* Copyright (c) 2006 Intel Corporation - * All rights reserved. - * - * This file is distributed under the terms in the attached INTEL-LICENSE - * file. If you do not find these files, copies can be found by writing to - * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, - * 94704. Attention: Intel License Inquiry. - */ -/* Authors: David Gay - * Intel Research Berkeley Lab - */ - +/* + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2006 Intel Corporation. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + Contact Information: + David Gay, david.e.gay@intel.com + Intel Labs Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 94704 + + BSD LICENSE + + Copyright(c) 2006 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ #ifdef __MSP430 #include #else @@ -80,7 +126,7 @@ unsigned byte_offset = offset >> 3; \ unsigned bit_offset = offset & 7; \ \ - x = x & ((1 << length) - 1); \ + x = x & (((uint ## bits ## _t)1 << length) - 1); \ \ /* all in one byte case */ \ if (length + bit_offset <= 8) { \ @@ -155,7 +201,7 @@ \ while (count + 8 <= length) \ { \ - x |= (uint ## bits ## _t)(msg[byte_offset++] << count); \ + x |= (uint ## bits ## _t)msg[byte_offset++] << count; \ count += 8; \ } \ \ @@ -172,7 +218,7 @@ unsigned bit_offset = offset & 7; \ unsigned count = 0; \ \ - x = x & ((1 << length) - 1); \ + x = x & (((uint ## bits ## _t)1 << length) - 1); \ \ /* all in one byte case */ \ if (length + bit_offset <= 8) { \