ResizeablePointer const fix
This commit is contained in:
		
							parent
							
								
									93114d53f9
								
							
						
					
					
						commit
						68c87a44d0
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -171,14 +171,14 @@ namespace Util{
 | 
				
			||||||
    maxSize = 0;
 | 
					    maxSize = 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool ResizeablePointer::assign(void * p, uint32_t l){
 | 
					  bool ResizeablePointer::assign(const void * p, uint32_t l){
 | 
				
			||||||
    if (!allocate(l)){return false;}
 | 
					    if (!allocate(l)){return false;}
 | 
				
			||||||
    memcpy(ptr, p, l);
 | 
					    memcpy(ptr, p, l);
 | 
				
			||||||
    currSize = l;
 | 
					    currSize = l;
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool ResizeablePointer::append(void * p, uint32_t l){
 | 
					  bool ResizeablePointer::append(const void * p, uint32_t l){
 | 
				
			||||||
    if (!allocate(l+currSize)){return false;}
 | 
					    if (!allocate(l+currSize)){return false;}
 | 
				
			||||||
    memcpy(((char*)ptr)+currSize, p, l);
 | 
					    memcpy(((char*)ptr)+currSize, p, l);
 | 
				
			||||||
    currSize += l;
 | 
					    currSize += l;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,8 +21,8 @@ namespace Util{
 | 
				
			||||||
      ResizeablePointer();
 | 
					      ResizeablePointer();
 | 
				
			||||||
      ~ResizeablePointer();
 | 
					      ~ResizeablePointer();
 | 
				
			||||||
      inline uint32_t& size(){return currSize;}
 | 
					      inline uint32_t& size(){return currSize;}
 | 
				
			||||||
      bool assign(void * p, uint32_t l);
 | 
					      bool assign(const void * p, uint32_t l);
 | 
				
			||||||
      bool append(void * p, uint32_t l);
 | 
					      bool append(const void * p, uint32_t l);
 | 
				
			||||||
      bool allocate(uint32_t l);
 | 
					      bool allocate(uint32_t l);
 | 
				
			||||||
      inline operator char*(){return (char*)ptr;}
 | 
					      inline operator char*(){return (char*)ptr;}
 | 
				
			||||||
      inline operator void*(){return ptr;}
 | 
					      inline operator void*(){return ptr;}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue