Panda3D
 All Classes Functions Variables Enumerations
reversedNumericData.cxx
00001 // Filename: reversedNumericData.cxx
00002 // Created by:  drose (09May01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 #include "pnotify.h"
00017 
00018 #include "reversedNumericData.h"
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //     Function: ReversedNumericData::reverse_assign
00022 //       Access: Private
00023 //  Description: Actually does the data reversal.
00024 ////////////////////////////////////////////////////////////////////
00025 void ReversedNumericData::
00026 reverse_assign(const char *source, size_t length) {
00027   nassertv((int)length <= max_numeric_size);
00028   for (size_t i = 0; i < length; i++) {
00029     _data[i] = source[length - 1 - i];
00030   }
00031 }
 All Classes Functions Variables Enumerations