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.  
  2. using System;
  3.  
  4. namespace Dizzy
  5. {
  6.  
  7.  
  8. public class FileType {
  9.  
  10. int type;
  11. const int UNKNOWN = 0;
  12. const int VIDEO = 1;
  13. const int AUDIO = 2;
  14. const int BOOK = 3;
  15.  
  16. public FileType(string filename) {
  17.  
  18. if(filename.EndsWith(".avi"))
  19. type = VIDEO;
  20. else if(filename.EndsWith(".pdf"))
  21. type = BOOK;
  22. else if(filename.EndsWith(".mp3"))
  23. type = AUDIO;
  24. else
  25. type = UNKNOWN;
  26.  
  27. }
  28.  
  29. public string Name()
  30. {
  31. if(type == VIDEO)
  32. return "Video";
  33. else if(type == BOOK)
  34. return "Book";
  35. else if(type == AUDIO)
  36. return "Audio";
  37. else
  38. return "Sconosciuto";
  39. }
  40. }
  41.  
  42. public class File
  43. {
  44.  
  45.  
  46. public string user;
  47. public string name;
  48. public string path;
  49. public FileType type;
  50.  
  51. public File (string path, string user)
  52. {
  53. // Determino il tipo di file
  54. type = new FileType (path);
  55. string [] a;
  56. if (user == "")
  57. {
  58. a = path.Split('/');
  59. if (a.Length >= 2)
  60. user = a[2];
  61. }
  62. this.user = user;
  63. this.path = path;
  64. // Console.WriteLine("Path set to: {0}", this.path);
  65. string[] pieces = path.Split ('/');
  66.  
  67. name = pieces[pieces.Length - 1];
  68.  
  69. }
  70.  
  71.  
  72. }
  73. }