viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. #include "simple_audio.h"
  2. #include <math.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. sample* sa_note(sa_instrument instrument, char* note, int len) {
  7. return NULL;
  8. }
  9.  
  10.  
  11. sample sa_swap_bytes(sample s) {
  12. sample t;
  13. char* s_bytes;
  14. char* t_bytes;
  15. s_bytes = (char*) &s;
  16. t_bytes = (char*) &t;
  17.  
  18. t_bytes[0] = t_bytes[1];
  19. t_bytes[1] = s_bytes[0];
  20. return t;
  21. }
  22.  
  23.  
  24. int sa_write_samples(char* filename, sample* samples, int len) {
  25. FILE* handle;
  26. if( (handle = fopen(filename, "w")) == NULL )
  27. {
  28. fprintf(stderr, "Impossibile aprire il file %s\n", filename);
  29. exit(EXIT_FAILURE);
  30. }
  31.  
  32. int counter;
  33. sample buf;
  34. for(counter = 0; counter < len; counter ++) {
  35. buf = samples[counter];
  36. if(sa_is_little_endian()) { buf = sa_swap_bytes(buf); }
  37.  
  38. fwrite(&buf, 1, 1, handle);
  39. }
  40. fclose (handle);
  41. return EXIT_SUCCESS;
  42. }
  43.  
  44. int sa_is_little_endian() {
  45. return 0;
  46. }
  47.  
  48. int sa_is_big_endian() {
  49. return 1;
  50. }