[mono/mono] [5 commits] 4559c026: Fix inacurrate reference

"Sebastien Pouliot ([email protected])" <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <0000014185454ae6-593ec9d8-9384-41c1-a1cd-2c1383f3f590-000000@email.amazonses.com>
   Branch: refs/heads/monotouch-7.0.2-branch
     Home: https://github.com/mono/mono
  Compare: https://github.com/mono/mono/compare/4a4d7b4bf80d...63714aeff208

   Commit: 4559c026a8da817767141c71fcb0606f0f84c1b9
   Author: Miguel de Icaza <[email protected]> (migueldeicaza)
Committer: Sebastien Pouliot <[email protected]> (spouliot)
     Date: 2013-10-04 20:49:20 GMT
      URL: https://github.com/mono/mono/commit/4559c026a8da817767141c71fcb0606f0f84c1b9

Fix inacurrate reference

Changed paths:
  M mcs/class/corlib/System.IO/Path.cs

Modified: mcs/class/corlib/System.IO/Path.cs
===================================================================
@@ -289,9 +289,8 @@ public static string GetFullPath (string path)
 			return fullpath;
 		}
 
-		[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
 		// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx
-		// http://www.codeproject.com/Tips/223321/Win32-API-GetFullPathName
+		[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
 		private static extern int GetFullPathName(string path, int numBufferChars, StringBuilder buffer, ref IntPtr lpFilePartOrNull); 
 
 		internal static string GetFullPathName(string path)

   Commit: c0d35897df85be73ff208c10fc66152cffaf3313
   Author: Miguel de Icaza <[email protected]> (migueldeicaza)
Committer: Sebastien Pouliot <[email protected]> (spouliot)
     Date: 2013-10-04 20:49:45 GMT
      URL: https://github.com/mono/mono/commit/c0d35897df85be73ff208c10fc66152cffaf3313

Add actual source

Changed paths:
  M mcs/tools/mkbundle/template_z.c

Modified: mcs/tools/mkbundle/template_z.c
===================================================================
@@ -13,7 +13,8 @@
 	memset (&stream, 0, sizeof (z_stream));
 	stream.next_in = (Byte *) compr;
 	stream.avail_in = (uInt) compr_len;
-	/* To decompress gzip format: http://stackoverflow.com/a/1838702/83444 */
+
+	// http://www.zlib.net/manual.html
 	err = inflateInit2 (&stream, 16+MAX_WBITS);
 	if (err != Z_OK)
 		return 1;

   Commit: 1b5a6dc7ea56e61db6ca1f1d2897645d88583a9a
   Author: Miguel de Icaza <[email protected]> (migueldeicaza)
Committer: Sebastien Pouliot <[email protected]> (spouliot)
     Date: 2013-10-04 20:50:38 GMT
      URL: https://github.com/mono/mono/commit/1b5a6dc7ea56e61db6ca1f1d2897645d88583a9a

Remove CodeProject licensed code

Changed paths:
  M mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs

Modified: mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs
===================================================================
@@ -66,14 +66,8 @@ public override bool IsValid(object value)
 			//
 			// See: http://en.wikipedia.org/wiki/Luhn_algorithm
 			// See: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers
-			// See: http://www.codeproject.com/Tips/515367/Validate-credit-card-number-with-Mod-10-algorithm
 
-			int sumOfDigits = creditCardNumber.Where((e) => e >= '0' && e <= '9')
-				.Reverse()
-				.Select((e, i) => ((int)e - 48) * (i % 2 == 0 ? 1 : 2))
-				.Sum((e) => e / 10 + e % 10);
-
-			return sumOfDigits % 10 == 0;
+			return true;	
 		}
 	}
 }

   Commit: 213c97b038340818c39d6f17cbccea10c41529de
   Author: Miguel de Icaza <[email protected]> (migueldeicaza)
Committer: Sebastien Pouliot <[email protected]> (spouliot)
     Date: 2013-10-04 20:53:34 GMT
      URL: https://github.com/mono/mono/commit/213c97b038340818c39d6f17cbccea10c41529de

This regex was wrong in the first place, and second, it uses CC code from Stackoverflow

Changed paths:
  M mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs

Modified: mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs
===================================================================
@@ -40,11 +40,6 @@ namespace System.ComponentModel.DataAnnotations
 	public class EmailAddressAttribute : DataTypeAttribute
 	{
 		private const string DefaultErrorMessage = "The {0} field is not a valid e-mail address.";
-		// See: http://stackoverflow.com/questions/16167983/best-regular-expression-for-email-validation-in-c-sharp
-		// See: http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
-		private const string _emailRegexStr =   @"[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" +
-						  	@"@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+(?:[A-Za-z]{2}|" +
-						    	@"com|org|net|edu|gov|cat|mil|biz|info|mobi|name|aero|asia|jobs|museum|coop|travel|post|pro|tel|int|xxx)\b";
 		private static Regex _emailRegex = new Regex (_emailRegexStr, RegexOptions.IgnoreCase | RegexOptions.Compiled);
 
 		public EmailAddressAttribute ()
@@ -60,10 +55,7 @@ public override bool IsValid(object value)
 				return true;
 
 			if (value is string)
-			{
-				var str = value as string;
-				return !string.IsNullOrEmpty(str) ? _emailRegex.IsMatch(str) : false;
-			}
+				return true;
 
 			return false;
 		}

   Commit: 63714aeff2081c8a2ea19c994aedee85a1e52a43
   Author: Zoltan Varga <[email protected]> (vargaz)
Committer: Sebastien Pouliot <[email protected]> (spouliot)
     Date: 2013-10-04 20:54:03 GMT
      URL: https://github.com/mono/mono/commit/63714aeff2081c8a2ea19c994aedee85a1e52a43

[sgen] Use gcc bitcount intrinsics where appropriate.

Changed paths:
  M mono/metadata/sgen-marksweep.c

Modified: mono/metadata/sgen-marksweep.c
===================================================================
@@ -1574,22 +1574,20 @@ struct _MSBlockInfo {
 static inline int
 bitcount (mword d)
 {
-#if SIZEOF_VOID_P == 8
-	/* http://www.jjj.de/bitwizardry/bitwizardrypage.html */
-	d -=  (d>>1) & 0x5555555555555555;
-	d  = ((d>>2) & 0x3333333333333333) + (d & 0x3333333333333333);
-	d  = ((d>>4) + d) & 0x0f0f0f0f0f0f0f0f;
-	d *= 0x0101010101010101;
-	return d >> 56;
+	int count = 0;
+
+#ifdef __GNUC__
+	if (sizeof (mword) == sizeof (unsigned long))
+		count += __builtin_popcountl (d);
+	else
+		count += __builtin_popcount (d);
 #else
-	/* http://aggregate.org/MAGIC/ */
-	d -= ((d >> 1) & 0x55555555);
-	d = (((d >> 2) & 0x33333333) + (d & 0x33333333));
-	d = (((d >> 4) + d) & 0x0f0f0f0f);
-	d += (d >> 8);
-	d += (d >> 16);
-	return (d & 0x0000003f);
+	while (d) {
+		count ++;
+		d &= (d - 1);
+	}
 #endif
+	return count;
 }
 
 static void


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.