There is no reason to set the initial max value low like that. Just assign it the value of the first element (the OP actually did this). Giving it a signed type limits the upper ranges by half, so unless you're really needing signed data, it's just doesn't make sense to do it that way. Actually, the cononical way to do it would be to return a pointer to the max element:

Code:
template <class t_type>
 t_type * maxptr(t_type data[], unsigned size)
{
 t_type * ret = data; 

     for(t_type * end = data+size; data != end; ++data)  {

         if(*data > *ret)  {
          ret = data;
       } 
    } 
 return ret;
}

Which you would then use to return a value:


Code:
template <class t_type>
 t_type max(t_type data[], unsigned size)
{
 return *maxptr(data, size);
}

or change a value:


Code:
template <class t_type>
 void hipassfilter(t_type data[], unsigned size, t_type ceiling)
{
    for(type_t * smp = maxptr(data, size); *smp > ceiling; smp = maxptr(data, size))  {
     *smp = ceiling;
   }
}