Codebase list ohcount / 039afe7 debian / patches / conflicting-type.diff
039afe7

Tree @039afe7 (Download .tar.gz)

conflicting-type.diff @039afe7raw · history · blame

From d844bfeac7d885c45754649a8108adf58f8d0e4b Mon Sep 17 00:00:00 2001
From: Adrian Cornish <acornish@spotxchange.com>
Date: Tue, 5 Sep 2017 15:04:53 -0600
Subject: [PATCH] Some fixes for building on Fedora

---
 ruby/print_arch | 6 +++---
 src/languages.h | 2 +-
 src/parser.c    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Index: ohcount/ruby/print_arch
===================================================================
--- ohcount.orig/ruby/print_arch
+++ ohcount/ruby/print_arch
@@ -3,13 +3,13 @@ require 'mkmf'
 
 arch = RbConfig::expand(CONFIG["arch"])
 
-distro = if File.exist?("/etc/issue")
+distro = if File.exist?("/etc/os-release")
   # this is "", "CentOS" or "Ubuntu"
-  `cat /etc/issue`.split.first.downcase
+  `egrep "^ID=.*" /etc/os-release`.split("=")[1].downcase
 end
 
 unless ["centos", nil, "ubuntu"].include? distro
-	STDERR.puts "unhandled /etc/issue result: #{distro}"
+	STDERR.puts "unhandled /etc/os-release result: #{distro}"
 end
 
 # either <arch> or <arch>_<distro> if distro is non-null
Index: ohcount/src/languages.h
===================================================================
--- ohcount.orig/src/languages.h
+++ ohcount/src/languages.h
@@ -120,6 +120,6 @@
 
 // For gperf.
 struct LanguageMap { const char *key; const char *name; const char *nice_name; int category; };
-struct LanguageMap *ohcount_hash_language_from_name(register const char *str, register unsigned int len);
+struct LanguageMap *ohcount_hash_language_from_name(register const char *str, register size_t len);
 
 #endif
Index: ohcount/src/parser.c
===================================================================
--- ohcount.orig/src/parser.c
+++ ohcount/src/parser.c
@@ -7,7 +7,7 @@
 #include "log.h"
 #include "hash/parser_hash.h"
 
-struct ParserMap * ohcount_hash_parser_from_language (register const char *str, register unsigned int len);
+struct ParserMap * ohcount_hash_parser_from_language (register const char *str, register size_t len);
 
 int ohcount_parse(SourceFile *sourcefile, int count,
                   void (*callback) (const char *, const char *, int, int,