Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ply/plyfile.cpp

    r12577 r13041  
    1 /* Copyright (c) 2005-2007, Stefan Eilemann <eile@equalizergraphics.com>  
     1/* Copyright (c) 2005-2007, Stefan Eilemann <eile@equalizergraphics.com> 
    22   All rights reserved. 
    33   - Cleaned up code for 64 bit, little and big endian support 
     
    2626 
    2727Copyright (c) 1994 The Board of Trustees of The Leland Stanford 
    28 Junior University.  All rights reserved.    
    29    
    30 Permission to use, copy, modify and distribute this software and its    
    31 documentation for any purpose is hereby granted without fee, provided    
    32 that the above copyright notice and this permission notice appear in    
    33 all copies of this software and that you do not sell the software.    
    34    
    35 THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,    
    36 EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY    
    37 WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.    
     28Junior University.  All rights reserved. 
     29 
     30Permission to use, copy, modify and distribute this software and its 
     31documentation for any purpose is hereby granted without fee, provided 
     32that the above copyright notice and this permission notice appear in 
     33all copies of this software and that you do not sell the software. 
     34 
     35THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, 
     36EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
     37WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
    3838 
    3939*/ 
     
    136136    unsigned char* bytes = (unsigned char*)ptr; 
    137137    unsigned short* result = (unsigned short*)ptr; 
    138      
     138 
    139139    *result = (bytes[0]<<8) | bytes[1]; 
    140140} 
     
    146146 
    147147    *result = (bytes[0]<<24) | (bytes[1]<<16) | (bytes[2]<<8) | bytes[3]; 
    148 }     
     148} 
    149149 
    150150void swap8Bytes( void* ptr ) 
     
    152152    unsigned char* bytes = (unsigned char*)ptr; 
    153153    unsigned long long* result = (unsigned long long*)ptr; 
    154      
     154 
    155155    *result = ((unsigned long long)(bytes[0])) << 56 | 
    156156        ((unsigned long long)(bytes[1])) << 48 | 
     
    307307 
    308308  /* tack on the extension .ply, if necessary */ 
    309   name = (char *) myalloc (sizeof (char) *  
     309  name = (char *) myalloc (sizeof (char) * 
    310310                           (static_cast<int>(strlen (filename)) + 5)); 
    311311  strcpy (name, filename); 
     
    754754                                           sizeof (char *) * (plyfile->num_comments + 1)); 
    755755    } 
    756    
     756 
    757757  /* add comment to list */ 
    758758  plyfile->comments[plyfile->num_comments] = strdup (comment); 
     
    782782                                           sizeof (char *) * (plyfile->num_obj_info + 1)); 
    783783    } 
    784    
     784 
    785785  /* add info to list */ 
    786786  plyfile->obj_info[plyfile->num_obj_info] = strdup (obj_info); 
     
    830830  plyfile = (PlyFile *) myalloc (sizeof (PlyFile)); 
    831831  if (!plyfile) return (NULL); 
    832    
     832 
    833833  plyfile->nelems = 0; 
    834834  plyfile->comments = NULL; 
     
    895895    words = get_words (plyfile->fp, &nwords, &orig_line); 
    896896  } 
    897    
     897 
    898898 
    899899  /* create tags for each property of each element, to be used */ 
     
    951951  /* tack on the extension .ply, if necessary */ 
    952952 
    953   name = (char *) myalloc (sizeof (char) *  
     953  name = (char *) myalloc (sizeof (char) * 
    954954                           (static_cast<int>(strlen (filename) + 5))); 
    955955  strcpy (name, filename); 
     
    10561056 
    10571057    /* deposit the property information into the element's description */ 
    1058     for (i = 0; i < nprops; i++)  
     1058    for (i = 0; i < nprops; i++) 
    10591059    { 
    10601060        /* look for actual property */ 
    10611061        prop = find_property (elem, prop_list[i].name, &index); 
    1062         if (prop == NULL)  
     1062        if (prop == NULL) 
    10631063        { 
    1064             fprintf ( stderr,  
     1064            fprintf ( stderr, 
    10651065                      "Warning:  Can't find property '%s' in element '%s'\n", 
    10661066                      prop_list[i].name, elem_name ); 
     
    13041304  other->size = elem->other_size; 
    13051305  other->props = (PlyProperty **) myalloc (sizeof(PlyProperty*) * elem->nprops); 
    1306    
     1306 
    13071307  /* save descriptions of each "other" property */ 
    13081308  nprops = 0; 
     
    13231323  } 
    13241324#endif 
    1325    
     1325 
    13261326  /* return structure */ 
    13271327  return (other); 
     
    15351535    } 
    15361536  free (plyfile->comments); 
    1537    
     1537 
    15381538  for (i=0; i<plyfile->num_obj_info; i++) 
    15391539    { 
     
    15411541    } 
    15421542  free (plyfile->obj_info); 
    1543    
     1543 
    15441544  free (plyfile); 
    15451545} 
     
    16021602        if (equal_strings (element, plyfile->elems[i]->name)) 
    16031603            return (plyfile->elems[i]); 
    1604      
     1604 
    16051605    return (NULL); 
    16061606} 
     
    16221622{ 
    16231623    int i; 
    1624      
     1624 
    16251625    for( i = 0; i < elem->nprops; i++) 
    16261626        if (equal_strings (prop_name, elem->props[i]->name)) 
     
    16291629            return (elem->props[i]); 
    16301630        } 
    1631      
     1631 
    16321632    *index = -1; 
    16331633    return (NULL); 
     
    18281828       * so that zipper won't crash reading plies that have additional 
    18291829       * properties. 
    1830        */  
     1830       */ 
    18311831      if (store_it) { 
    18321832        item_size = ply_type_size[prop->internal_type]; 
     
    27612761  ptr = (char *) malloc (size); 
    27622762 
    2763   if (ptr == 0)  
    2764       fprintf( stderr, "Memory allocation bombed on line %d in %s\n",  
     2763  if (ptr == 0) 
     2764      fprintf( stderr, "Memory allocation bombed on line %d in %s\n", 
    27652765               lnum, fname); 
    27662766